One of the most common errors encountered in the MySQL world at large is the infamous Error 1040:
ERROR 1040 (00000): Too many connections
What this means in practical terms is that a MySQL instance has reached its maximum allowable limit for client connections. Until connections are closed, no new connection will be accepted by the server.
I’d like to discuss some practical advice for preventing this situation, or if you find yourself in it, how to recover.
Accurately Tune the max_connections Parameter
This setting defines the maximum number of connections that a MySQL instance will accept. Considerations on “why” you would want to even have a max number of connections are based on resources available to the server and application usage patterns. Allowing uncontrolled connections can crash a server, which may be considered “worse” than preventing further …[Read more]