MySQL wait_timeout value?

Collabora

Account Disabled
Poll: For a shared hosting environment what is the optimal value for the MySQL wait_timeout variable?

Explain. What is your reasoning?
 
Last edited:
MySQL wait_timeout value is nothing but the amount of time that MySQL will wait before killing an idle connection.
Default value around 28800 seconds is too high so it should be around 90-300 seconds in my view.
 
Having a long value will keep many connections in open state, and may cause a huge slowdown in your mysql server.
 
As it's the amount of time that it will stay in an idle state - a lower number is generally fine.

Realistically anything less than 30 minutes should be fine unless it's an extremely busy server.
 
We used to keep these numbers at the 300 seconds. The more important numbers were the processing times and the connection timeouts being at 10 seconds. Users are impatient, so keeping those numbers low prevent scripts from running out of control. Same thing with php timeouts.

But the wait_timeout set too low will result in a "connection has gone away" and will cause more frustration.

Definitely changing the default from the 6 or 8 hours that it comes with to a maximum of 1 hour would be a minimal task, but as @MikeDVB said, even at 30 minutes, you should be fine.
 
90-300 seconds is fair enough.

On Shared hosting, there are either personal, small or medium business sites. They are not kind of huge sites who needs big data to fetch from mysql server. Setting up huge connection time will keep server busy and can caused serious problem.

Also, these days clients are impatient (agree with bigredseo), they are not going to wait for minuts to see the result.

So looking at all things on shared hosting upto 300seconds time out is fair enough.
 

Forum statistics

Threads
80,955
Messages
248,490
Members
20,683
Latest member
tombarko8
Top