MySQL Forums
Forum List  »  Performance

PHP/MySQL to use all CPU/memory to increase performance
Posted by: Caleb Pitman
Date: September 21, 2014 11:04AM

Hello,

This may be a PHP issue or MySQL. I made an example for illustration only; why does this example not burn up all the servers CPU/memory to complete it faster? Is there a way to do this? The processes handling a similar script are only using less than 1% of the servers resources. It is a dedicated server.

[php]
$query = mysql_query("SELECT * FROM tableExample WHERE criteria5 = 'example'");
while($results = mysql_fetch_assoc($query)) {
mysql_query("UPDATE tableExample_2x SET val1='$result[stuff]' WHERE associativeID = $results[id]");
}
[/php]


Any ideas or suggestions?



PHP config:
memory_limit: 4GB




my.conf
**********************
[mysql]

# CLIENT #
port=3306
socket="/var/lib/mysql/mysql.sock"

[mysqld]
slow-query-log=1
long_query_time=1

# GENERAL #
user=mysql
default-storage-engine=InnoDB
socket="/var/lib/mysql/mysql.sock"
pid-file="/var/lib/mysql/mysql.pid"

# MyISAM #
key-buffer-size=32M
myisam-recover="FORCE,BACKUP"

# SAFETY #
max-allowed-packet=1G
max-connect-errors=1000000

# DATA STORAGE #
datadir="/var/lib/mysql/"

# BINARY LOGGING #
log-bin="/var/lib/mysql/mysql-bin"
expire-logs-days=14
sync-binlog=1

# CACHES AND LIMITS #
tmp-table-size=32M
max-heap-table-size=32M
query-cache-type=0
query-cache-size=0
max-connections=5000
thread-cache-size=50
open-files-limit=65535
table-definition-cache=1024
table-open-cache=2048

# INNODB #
innodb-flush-method=O_DIRECT
innodb-log-files-in-group=2
innodb-flush-log-at-trx-commit=2
innodb-file-per-table=1
innodb-buffer-pool-size=6G

# LOGGING #
log-error="/var/lib/mysql/mysql-error.log"
log-queries-not-using-indexes=1
innodb_buffer_pool_size=134217728
max_allowed_packet=268435456
port=5123

Options: ReplyQuote


Subject
Views
Written By
Posted
PHP/MySQL to use all CPU/memory to increase performance
2871
September 21, 2014 11:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.