June 20, 2013

Post: Shard-Query EC2 images available

… config for 20 shards (adjust to your number of nodes) php genconfig 20 > shards.ini Running the test For best performance…-size=16M key-buffer-size=64M local-infile=on lock-wait-timeout=300 log-error=/var/log/mysqld-innodb.log max-allowed…-size=64M transaction-isolation=READ-COMMITTED user=mysql wait-timeout=86400 To be continued You can now set up a cluster from 1 to…

Post: Worse than DDOS

…’re using PHP functions make sure default_socket_timeout has proper value or set it per session. Set Curl Timeouts Set both TIMEOUT and CONNECT_TIMEOUT as these apply to different connection stages and just setting timeout is not enough. Beware of PHP sessions… curl module (or mysqlwaiting on long query to come back) – this is our query if it is waiting on the session file…

Post: Apache PHP MySQL and Runaway Scripts

… can get your PHP script running too long, well after user stopped waiting for the page …MySQL Connection and other resources. I had discussion today who was thinking Apache would kill the script after “Timeout… script did not output anything the 120 “Timeoutset on Apache size did not seem to work…

Comment: Why do you need many apache children ?

…. Timeout setting in httpd.conf do great harm to so many mysql connections in sleep state for so long time(wait_timeout). Original timeout was set to… concurrent apache child processes, so Naver prepare to add new php dedicated web server when concurrent apache connection reaches to 100…

Post: Are PHP persistent connections evil ?

…spend some time in “FIN” stage waiting before they can be recycled. On…”/proc/sys/net/ipv4/tcp_fin_timeout” to reduce recycle delay. Reducing last… added to PHP during times of MySQL 3.22/3.23 when MySQL was simple… to recycle connections with custom character set settings you’re in trouble back again,…

Comment: Pitfalls of converting to InnoDB

PHP 5.1.6, MySQL 5.0.24a default installs from Ubuntu 6.10, so pretty recent + standard. I’m using the PHP…Another PHP script attempting to insert takes 50 seconds to time-out with a “1205 – Lock wait timeout …_function()” when I start a transaction, and set a flag to indicate a transaction is …

Comment: Debugging sleeping connections with MySQL

… better way than restarting your server or whatever is to set a MySQL value that does not allow connections to last over…. my.cnf: wait_timeout=180 # = 30min php cron script: #!/usr/bin/php -q 1000 && $row['Command'] == “Sleep”) && ($row['User'] != “Root”)) { $killed = 0; mysql_query(“kill…