Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. 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

From time to time my mysql server will run into a "too many connections" error. I believe part of the problem is large amount of sleep processes that are running, some over 1000 seconds.

When looking into the issue, I saw this and investigated. I checked my timeout values with

show variables like "%timeout";

And both interactive_timeout and wait_timeout are set to 600.

How/Why would these sleep processes be running so long, if they're supposed to stop at 600?

share|improve this question
up vote 1 down vote accepted

There are two possibilities the come to mind:

  • the values of interactive_timeout and wait_timeout were not 600 when those threads first connected, so they are using the values that existed when they first connected, or
  • the application is changing the timeout values for its sessions after connecting.

If you're running out of available connections, though, why not just raise max_connections? If the threads are sleeping, you're not talking about a significant resource cost.

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.