At the weekend we kept getting the 'too many connections' error. I look at the open processes and it shows about 250 processes sleeping for long periods.
Code:
Id         | User   |  Host     | db   | Command | Time | State | Info             |
+----------+--------+-----------+------+---------+------+-------+-----
| 15160505 | myuser | localhost | mydb | Sleep   | 7308 |       |                  |
etc... about 250 of them. Why is this? Is it a problem with mysql (maybe the configuration) or the php layer not closing connections? Things are normally absolutely fine. Could this be some kind of attack on our server? Seems unlikely as the open processes aren't actually doing anything.