I'm running Plesk for my users to set up their MySQL databases. Recently, have been getting a bunch of errors resulting from:
"Warning: Too many connections"
The system admin upped the number of connections avail on the server but wondering if there was a better method to handle this problem in the future? Or is it just bad MySQL coding? I see increasing the connection limit as a temporary solution.
One of the problems could be that our users are not using persistent connections to the database. We could tell all our users to use the ‘pconnect’ function because it recycles open connections and implicitly closes unused connections. If they use ‘connect’ MySQL will not automatically close the connection unless the user explicitly closes the connection in their code. The more connections open the more memory the servers uses. The domino effect will slow everything down on the server.