I\'m running a Spring/Hibernate connecting to MySQL setup using c3p0 as my connection pool. For some bizarre reason it runs out of connections when the system is under load (of
Regardless of the configuration you have for C3P0 (through hibernate) you might have a restriction imposed by MySQL itself. Keep in mind that by default the maximum number of connections allowed by MySQL is 100! So even if you tell C3P0 to pool up to 200, 500 or 1000 connections, this will be unachievable. Open a MySQL shell using:
$ msql -u [user] -p
And type the following to get the maximum number of connections allowed:
$ show variables where Variable_name='max_connections';
If the number returned is too low for your application, consider changing it (edit your my.cnf file, usually located inside /etc/mysql/ on Linux systems).