What is the difference between :
mysql.connect_timeout
that we can find in php.ini
and
connect_timeout
that belongs to mysql configuration (show variables
).
Knowing that apache server and mysql server are two distant VPS with a VIP between them, what is the value considered by the whole environment (Varnish + Apache + Mysql) ?
MySQL has its wait_timeout variable default value set to 28800 seconds (8 hours).
The most common reason for the MySQL server has gone away error is that the server timed out and closed the connection. In this case, you normally get one of the following error codes (which one you get is operating system-dependent). The client couldn't send a question to the server.
mysql.connect_timeout
tells PHP how long it should wait for a response from the MySQL server when it tries to connect.
connect_timeout
in MySQL configuration tells the MySQL server how long to wait for a connect packet from the client before responding with a Bad handshake
error.
Apache is not involved in either of these timeouts, they're just between PHP and MySQL. First PHP connects to MySQL; if it doesn't get a response before mysql.connect_timeout
, it will report an error. Once that succeeds, PHP sends a connect
packet to MySQL; if it doesn't do that within connect_timeout
, MySQL will report an error and close the connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With