Wij gebruiken MySQL i.c.m. c3p0 om connecties aan te maken in ons systeem. Nu werkt dat vrij goed, maar zodra het druk wordt, blijkt er een probleem te ontstaan.
Wanneer het aantal connecties in de pool oploopt zie ik dat het aantal connecties oploopt (duh). Maar wanneer de pool weer slinkt als het rustig wordt blijft hetzelfde aantal connecties in MySQL open staan.
Als hierna de pool weer groeit bij drukte worden de openstaande MySQL connecties niet gerecycled, maar worden er weer nieuwe connecties aangemaakt.
Of c3p0 sluit de connecties niet goed wanneer hij ze released of MySQL wil ze niet sluiten?
Uiteindelijk krijgt c3p0 geen connecties meer van MySQL omdat hij tegen de max_connections (=100) aanloopt.
Mijn c3p0 config ziet er alsvolgt uit:
In MySQL heb ik de volgende settings staan:
Nu ben ik niet echt een DB-admin, maar ik zie even niet waar het probleem nou zou moeten zitten?
Wanneer het aantal connecties in de pool oploopt zie ik dat het aantal connecties oploopt (duh). Maar wanneer de pool weer slinkt als het rustig wordt blijft hetzelfde aantal connecties in MySQL open staan.
Als hierna de pool weer groeit bij drukte worden de openstaande MySQL connecties niet gerecycled, maar worden er weer nieuwe connecties aangemaakt.
Of c3p0 sluit de connecties niet goed wanneer hij ze released of MySQL wil ze niet sluiten?
Uiteindelijk krijgt c3p0 geen connecties meer van MySQL omdat hij tegen de max_connections (=100) aanloopt.
Mijn c3p0 config ziet er alsvolgt uit:
XML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| <c3p0-config> <default-config> <property name="autoCommitOnClose">false</property> <property name="initialPoolSize">5</property> <property name="maxPoolSize">50</property> <property name="minPoolSize">5</property> <property name="checkoutTimeout">1000</property> <!-- keep alive config --> <property name="automaticTestTable">c3p0_test_table</property> <property name="idleConnectionTestPeriod">1800</property> <property name="testConnectionOnCheckin">true</property> <!-- connection expiration --> <property name="maxConnectionAge">28200</property> <property name="maxIdleTime">28200</property> <property name="maxIdleTimeExcessConnections">1800</property> </default-config> </c3p0-config> |
In MySQL heb ik de volgende settings staan:
connect_timeout | 5 |
interactive_timeout | 28800 |
max_connect_errors | 10 |
max_connections | 100 |
max_user_connections | 0 |
wait_timeout | 28800 |
Nu ben ik niet echt een DB-admin, maar ik zie even niet waar het probleem nou zou moeten zitten?
The ships hung in the sky in much the same way that bricks don’t.