At the moment we have 6 webservers (RedHat) behind a loadbalancer which use one dedicated MySQL server (plus two smaller dedicated MySQL servers for a few special sites) for their data. On setting that seems to cause headaches is MySQL's "max connecterrors". We cannot find which conditions cause connect errors. It seems to be at least: - webserver dies (and is removed from the loadbalancing system until it is revived/repaired) - PHP script runs out of memory and dies without saying farewell. - ??? Without knowing the conditions it is hard to prevent connect errors.
This has turned out to be important since the "max connecterrors" setting seems to count from the time MySQL is started. So if a webserver dies, reboots and tries to connect again, it is likely to meet a mysql server that has the server blocked since there were too many connect errors. Right now we have cron job running that periodically flushes the connecterrors...
You can set max_connect_errors to a very large number. Also, connect error count is incremented only when a new connection is being established and the handshake terminates abnormally. If this value is high, it means your web servers are dying or stall for some other reason right when they are establishing the connection. This appears to me more like you have very heavily overloaded web servers or some serious trouble on the network.
The second problem is with a setting in PHP that will most likely be send directly to the mysql client. The PHP manual says that mysql.connect_timeout on Linux specifically means "the timeout for the connection as well as for the first response from the database server". What is meant by the first response from the database server? The connection itself should be rather fast (a couple of seconds), but a query might take longer (is that the first response?).
Probably a better definition for this would be - how long we wait for an expected packet from the server during the establishement of a MySQL (not just TCP/IP) connection. It does not affect queries.
-- Sasha Pachev Create online surveys at http://www.surveyz.com/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]