Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2
Hi Chris, Thanks for reply. I had tried using com.mysql.jdbc.Driver as well earlier. But no luck :( Christopher Schultz-2 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yagnesh, On 11/17/2009 12:32 AM, Yagnesh Chawda wrote: Thanks Chris, That was just a typo. Thanks for pointing it out. But in real configuration was was not commented. It was some other config which I was trying and forgot to uncomment it in posting. Ok. bean id=dataSource destroy-method=close class=org.apache.commons.dbcp.BasicDataSource property name=driverClassName value=com.mysql.jdbc.jdbc2.optional.MysqlDataSource/ property name=url value=${db.url}/ property name=username value=${db.user}/ property name=password value=${db.pass}/ property name=initialSize value=40/ property name=minIdle value=35/ property name=maxActive value=95/ property name=maxWait value=2/ /bean I find it unusual that you'd be using a DataSource as the driver class name. Typically, for MySQL, you'd use com.mysql.jdbc.Driver as the class name, not the MySQL-supplied DataSource as the driver class name. Other than that, I would expect your connection pool to always have a minimum of 35 connections sitting idle in it, even when your site was seeing no traffic. I wonder if the problem is that you appear to be using two data sources instead of one data source and one JDBC driver. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksCvlgACgkQ9CaO5/Lv0PCNRQCgwqSmsc1EUj7aCxh1hGhGjImC 7IIAnjC4PQCrSepnOuMUvAcAIAQy8Kia =8Fl9 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://old.nabble.com/Tomcat-DBCP-Connection-Pooling-to-MySQL-limited-number-of-connection-issue-in-Spring2.5-%2B-Hibernate3-%2B-commons-DBCP1.2-tp26372475p26392261.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2
Hi, There is no difference in the outcome when I use com.mysql.jdbc.Driver max_connections=200 is still same in MySQL. I confirmed that MySQL is able to handle that much load by running JMeter load testing which causes my application to create even 95 connection if I set maxActive connections in my pool = 95. BUt problem is that with each HTTP request from JMeter, if pool is creating new connection to MySQL as only 8-9 connections are available in pool. And pool drops connection immediately after serving that request. I hope that I have told you that, pool attempts to create initialSize number of connections to the MySQL server. But it also drops it off immediately in a second or two, leaving behind only 8-9 pooled connection. Christopher Schultz-2 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yagnesh, On 11/17/2009 10:51 AM, Yagnesh Chawda wrote: Thanks for reply. I had tried using com.mysql.jdbc.Driver as well earlier. But no luck :( What does happen when you use com.mysql.jdbc.Driver? What are the current values for max_connections and max_user_connections in MySQL? I know you said you set max_connections=200 but I just wanted to make sure that MySQL actually has that setting while it's running. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksDG/IACgkQ9CaO5/Lv0PBc0wCgq7YxJdaIHiCbiKUTwngX99QI gqoAoL9T9Yw4WR4NXF8gDbC/F6KyDZ1F =YvGV -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://old.nabble.com/Tomcat-DBCP-Connection-Pooling-to-MySQL-limited-number-of-connection-issue-in-Spring2.5-%2B-Hibernate3-%2B-commons-DBCP1.2-tp26372475p26402989.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2
Hi, I am using Spring 2.5, Hibernate 3 and MySQL (5.0.45 (32 Bit), 5.0.84(64 Bit)) with commons-DBCP 1.2 in Tomcat-5.5 My issue is that even after specifying Connection pool of initialSize=40 and minIdle=35, my App. server is never keep only 9 connections open under zero load condition. What I could figure out from the MySQL log was that, server did created 40 connections, but also dropped each connection in 1-2 seconds after connection started. I have max_connection=200 in MySQL, and time to keep idle connection in MySQL is also 8Hrs. Under load, App server creates connections upto 95 as I have described it as maxActive=95 I confirmed it thru show global status and show processlist on MySQL prompt while simulating a heavy traffic thru JMeter. I tried with c3p0 from Hibernate, but no luck. Outcome is exactly same. So am wondering what the issue is ?? My bean definition is as follows for DBCP: bean id=dataSource destroy-method=close class=org.apache.commons.dbcp.BasicDataSource !--property name=driverClassName value=com.mysql.jdbc.jdbc2.optional.MysqlDataSource/ property name=url value=${db.url}/ property name=username value=${db.user}/ property name=password value=${db.pass}/ property name=initialSize value=40/ property name=minIdle value=35/ property name=maxActive value=95/ property name=maxWait value=2/ -- /bean !-- Hibernate related Beans definition starts here -- bean id=sessionFactory class=org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean property name=dataSource ref=dataSource / property name=annotatedClasses list valuecom.domain.Company/value valuecom.domain.Country/value /list /property property name=hibernateProperties props prop key=hibernate.show_sqlfalse/prop prop key=hibernate.format_sqlfalse/prop prop key=hibernate.dialectorg.hibernate.dialect.MySQLDialect/prop prop key=hibernate.transaction.factory_classorg.hibernate.transaction.JDBCTransactionFactory/prop prop key=hibernate.cache.provider_classorg.hibernate.cache.EhCacheProvider/prop prop key=hibernate.cache.provider_configuration_file_resource_pathmy-ehcache.xml/prop prop key=hibernate.cache.use_structured_entriestrue/prop prop key=hibernate.cache.use_second_level_cachetrue/prop prop key=hibernate.cache.use_query_cachetrue/prop prop key=hibernate.default_batch_fetch_size30/prop prop key=hibernate.jdbc.batch_size30/prop prop key=hibernate.generate_statisticstrue/prop prop key=hibernate.order_updatestrue/prop prop key=hibernate.connection.release_modeauto/prop /props /property /bean -- View this message in context: http://old.nabble.com/Tomcat-DBCP-Connection-Pooling-to-MySQL-limited-number-of-connection-issue-in-Spring2.5-%2B-Hibernate3-%2B-commons-DBCP1.2-tp26372475p26372475.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2
Hey, Thanks Chris, That was just a typo. Thanks for pointing it out. But in real configuration was was not commented. It was some other config which I was trying and forgot to uncomment it in posting. Christopher Schultz-2 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yagnesh, On 11/16/2009 9:09 AM, Yagnesh Chawda wrote: My bean definition is as follows for DBCP: bean id=dataSource destroy-method=close class=org.apache.commons.dbcp.BasicDataSource !--property name=driverClassName value=com.mysql.jdbc.jdbc2.optional.MysqlDataSource/ property name=url value=${db.url}/ property name=username value=${db.user}/ property name=password value=${db.pass}/ property name=initialSize value=40/ property name=minIdle value=35/ property name=maxActive value=95/ property name=maxWait value=2/ -- /bean Your bean appears to be almost entirely commented-out. Is this your real configuration? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksCE8cACgkQ9CaO5/Lv0PDaRQCfWQPncqd/ykRg9AD4M43ag8FJ UKkAn0sSdb3b/pUDp9RDDV9KJG1noqys =MAA7 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://old.nabble.com/Tomcat-DBCP-Connection-Pooling-to-MySQL-limited-number-of-connection-issue-in-Spring2.5-%2B-Hibernate3-%2B-commons-DBCP1.2-tp26372475p26384679.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org