Connection Pooling - number of connections being limited

Discussions

Performance and scalability: Connection Pooling - number of connections being limited

  1. Hi, I am using Hibernate 3.1.3, Spring and MySQL 5. I am trying to use connection pooling with dbcp and c3p0 but it seems that the number of connections is always capped at 10. I have checked my MySQL configuration and the maximum number of connections allowed is 100, and there is no limit to user connections. I tried connection pooling with dbcp and c3p0 alternatively, but I still hit the limit of 10 no matter how I configure the initial or minimum pool sizes. By the way, I found out about this limit when I was doing load testing with JMeter. I'm pretty sure the bottleneck is at the data access layer, because even when I replace a data-intensive jsp page with a minimal data jsp page, I still get the throughput limited at 10 requests per second. I can't figure out where this limit is being set, and would really appreciate if someone could help! Here is my configuration: <!-- DHCP datasource (commented out) <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost/xxx"/> <property name="username" value="xxx"/> <property name="password" value="xxx"/> </bean> --> ... org.hibernate.dialect.MySQLInnoDBDialect false false true false org.hibernate.transaction.JDBCTransactionFactory org.hibernate.cache.OSCacheProvider thread update 80 20 20 15 25 1800 50 <!-- <prop key="hibernate.dbcp.maxActive">2</prop> <prop key="hibernate.dbcp.maxIdle">2</prop> <prop key="hibernate.dbcp.maxWait">120000</prop> <prop key="hibernate.dbcp.whenExhaustedAction">1</prop> <prop key="hibernate.dbcp.testOnBorrow">true</prop> <prop key="hibernate.dbcp.testOnReturn">true</prop> <prop key="hibernate.dbcp.validationQuery"> select 1; </prop> <prop key="hibernate.dbcp.ps.maxActive">5</prop> <prop key="hibernate.dbcp.ps.maxIdle">5</prop> <prop key="hibernate.dbcp.ps.maxWait">180000</prop> <prop key="hibernate.dbcp.ps.whenExhaustedAction">2</prop> -->
  2. Comments...[ Go to top ]


    I tried connection pooling with dbcp and c3p0 alternatively, but I still hit the limit of 10 no matter how I configure the initial or minimum pool sizes. By the way, I found out about this limit when I was doing load testing with JMeter. I'm pretty sure the bottleneck is at the data access layer, because even when I replace a data-intensive jsp page with a minimal data jsp page, I still get the throughput limited at 10 requests per second.
    Comments: ========= 1. What do you mean by 10 requests per second?. 2. How have you configured your JMeter?. 3. Does it have any rampup time?. How many client JMeter threads are there. 4. How long did you run your benchmarks to come to a conclusion about 10 requests per second. 5. If you feel its a bottleneck in DAO layer, can you try to quickly check the time taken there? ~Rajesh.B
  3. Hi, I am also facing ditto issue. I am using Hibernate 3, Spring 2.5 and Commons DBCP 2.2 for connection pooling. No matter what I set as "minIdle" and "initialSize" parameter in the bean definition for ConnectionPoolDataSOurce in spring, it always creates. When I fire "show processlist" on mysql, it always showed me 10 connection from my tomcat server. If I add two more parameters as below: With these two parameters it created more connections during the load, but again destroys them and and keeps only 10 connections ready. All extra connections are destroyed. Please let me know if some one has resolved the issue. Please mail me the solution to my email : yagnesh.chawda@gmail.com