Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

What is actual difference between wait_timeout and interactive_timeout?

share|improve this question

One is for interactive sessions, the other is for non-interactive sessions.

What's an interactive session? It's one with a human at the keyboard.

When your code connects to MySQL, runs a query and then spends 3 seconds processing that query before disconnecting, that's 3 seconds of the wait_timeout.

When you use the mysql command line client to connect, run a command and spend 10 seconds reading the output, that's 10 seconds of interactive_timeout. If you walk away and have lunch, that's 3600 seconds of interactive_timeout.

In both cases, when you or your code runs another query, the waiting time is reset back to 0.

You can see the values for all the current sessions by typing show processlist. The values in the sleep(5) function is the number of seconds since that connection last did anything.

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.