Set the maximum allowed number of connections in MySQL
MySQL has a setting which prevent the database from overloaded due to too many concurrent connections. This value should depends on the processing power of your database server, e.g. CPU, memory, disks I/O.
To change the value, edit the MySQL configurations, e.g. /etc/my.cnf
.. max_connections=100 ..
So if a client connecting to the database exceeded this value, they will be blocked.
Don't forget to restart MySQL to take effect.
# /sbin/service mysqld restart