MySql connection keep growing


I am using MySql database to store some information. If I run my project MySql connection are keep growing up to 4000. After that I am unable access my project and it web console. Why the mysql connections keep growing and some time the connection are very low but mostly I am facing the with many no of connections. Please share the information related to this.

Thanks in Advance.

You have to distinguish connections opened to your MySQL server from the actual busy ones, so doing some queries. Your problem may be the application not closing connections properly or your MySQL server is overloaded with bad (or just expensive, hence slow) queries and cannot keep up with rates requested by the application.
Use this simple query to find out which case you are dealing with:


Then, you can use Information_schema.processlist system diagnostics to get some statistics on what your connections are actually doing. Check this out for some examples: