Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a live server that's being hit hard so we're tying to optimise everything we can. We ran the MySQLTuner script on it ( which tells us we should set a value less than 28800 for wait_timeout & interactive_timeout. There's a lot of possible numbers to choose between 1 and 28800!

I looked up the meaning of these variables in the MySQL documentation but that gave only a very basic description and no guidance of choosing a value.

Is there a value that's considered a generally accepted best practice? And what would be the likely outcome of choosing a value that was too low?



share|improve this question
up vote 11 down vote accepted

wait_timeout is the amount of seconds during inactivity that MySQL will wait before it will close a connection on a non-interactive connection. interactive_timeout is the same, but for interactive sessions (mysql shell)

Setting a value too low may cause connections to drop unexpectedly, specifically if you are using persistent connections in your web application.

Setting a value too high may cause stale connections to remain open, preventing new access to the database.

IMO, for wait_timeout, you would want this value to be as low as possible without affecting availability and performance. You could start with 10 seconds and gradually increase it if you are seeing degraded performance.

For interactive_timeout, changing this value won't really increase or decrease performance of your application.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.