This just started happening all of the sudden.

We are using:

PHP 4.3.11 w/ mysql API 4.1.11


When our site is live, we get about 75-100 visitors per hour. We've been closely monitoring our processlist and notice spikes of threads from 3-5 (which is normal) to over 200!

We have not been able to pinpoint the problem, and it is being blamed on my code. My code connects to the database once per script, and it's even documented in debug output. Queries per page varies from 1-24 and this shouldn't affect the number of threads we have.

The threads would show up like this in mytop:

#### root ourdb_name # Sleep

They would appear in the hundreds and then quickly dissipate over a few seconds.

What could be creating hundreds of Sleeping threads in a matter of seconds. The spikes would happen randomly, we really have no way to track the problem. Maybe someone here would have some knowledge... Thanks!