We have a tasty mysql master + master setup running.
This helps greatly during some of the strange issues with innodb we have been having. But that’s another question…
In order to further optimize this mysql master + master setup, we would like to lower the mysql_connect timeout to something more like 1/2 a second. The database connection is all on a 1GB lan connection, all servers are of a higher-end, so chances are FAIRLY high that if a server doesn’t handshake within 0.5 secs, something is astray and connecting to one of the fail over servers would be a good idea. Currently we cannot go any lower then 1 second 🙁
Anyone know how to accomplish this?
Thanks!
You will not be able to accomplish this, not even by modifying PHP source (perhaps modifying mysql source can help)…if you look at PHP source code at http://svn.php.net/viewvc/php/php-src/trunk/ext/mysql/php_mysql.c?view=markup you will see that number of seconds read from php.ini is just set to mysql options, and from there, mysql is responsible for that timeout. It might happen that you can achieve that by modifying MySQL source code, but the question is are you ready to do that, for “I’m not sure how big” benefit you will have at the end…