Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yagnesh, On 11/18/2009 1:32 AM, Yagnesh Chawda wrote: There is no difference in the outcome when I use com.mysql.jdbc.Driver max_connections=200 is still same in MySQL. That is very strange. Can you try to configure the data source through Tomcat (that is, using a Resource element in your context.xml file) to see if it's the connection pool or if Spring is doing something behind the scenes? You could just code-up a simple JSP that does some database access using the DataSource that Tomcat configures and run a simple JMeter test against that. Don't bother deploying your own webapp because it will just make things more confusing. It's possible that Spring is doing something strange, here. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksEGuQACgkQ9CaO5/Lv0PDvHgCfTKIs4e7FUzslV+H86RElPE43 2i0AoKRwThEAY2gIuzEpVZ8NrLKFSLbA =BKur -END PGP SIGNATURE- - 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
-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
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
-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
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
UNSUBSCRIBE ME! I have been emailing you guys for over a week to unsubcribe me. PLEASE CEASE AND DESIST FROM SENDING ME MORE MAILINGS FROM THIS LIST! font color=redPlease visit our websites at/font http://www.geocities.com/evan_j_siegel'http://www.geocities.com/evan_j_siegel;http://www.geocities.com/evan_j_siegel and http://www.qlineorientalist.com/IranRises'http://www.qlineorientalist.com/IranRises;http://www.qlineorientalist.com/IranRises Thank you. From: Yagnesh Chawda yagnesh.cha...@gmail.com To: users@tomcat.apache.org Sent: Mon, November 16, 2009 9:09:51 AM Subject: 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
On 16/11/2009 14:12, Evan Siegel wrote: UNSUBSCRIBE ME! I have been emailing you guys for over a week to unsubcribe me. PLEASE CEASE AND DESIST FROM SENDING ME MORE MAILINGS FROM THIS LIST! You guys? There's only one email from you, that I can see to this list, which is this one. So... ? You managed to subscribe to the list, can't you follow the instructions on how to unsubscribe? Clues at the bottom of every email. p font color=redPlease visit our websites at/font http://www.geocities.com/evan_j_siegel'http://www.geocities.com/evan_j_siegel;http://www.geocities.com/evan_j_siegel and http://www.qlineorientalist.com/IranRises'http://www.qlineorientalist.com/IranRises;http://www.qlineorientalist.com/IranRises Thank you. - 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
2009/11/16 Pid p...@pidster.com: You managed to subscribe to the list, can't you follow the instructions on how to unsubscribe? Clues at the bottom of every email. We keep saying that, and it keeps being a problem for users. The email-based unsubscribe appears to be unreliable, I suspect due to an overzealous spam filter being applied to messages arriving at it. I don't know whether it's possible to implement an alternative web form-based approach that mails the user to confirm the unsubscribe, but allows the user to paste a verify code into the unsubscribe page so that they never have to email the Apache list server. - Peter - 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
Peter Crowther wrote: 2009/11/16 Pid p...@pidster.com: You managed to subscribe to the list, can't you follow the instructions on how to unsubscribe? Clues at the bottom of every email. We keep saying that, and it keeps being a problem for users. The email-based unsubscribe appears to be unreliable, I suspect due to an overzealous spam filter being applied to messages arriving at it. I don't know whether it's possible to implement an alternative web form-based approach that mails the user to confirm the unsubscribe, but allows the user to paste a verify code into the unsubscribe page so that they never have to email the Apache list server. It is clear that Evan is sending e-mail in HTML. That is almost enough on it's own to trigger the spam filter and most e-mails manage to trigger a couple more rules to push the score over the threshold. I thought that spam filtering on unsubscribe addresses had been disabled. I'll check that and if it hasn't see what can be done in that direction. I note that there has been zero communication from Evan to the list owner. I'll also note that the time it takes one of the list owners to unsubscribe someone who complains to the list tends to be directly proportional to the rudeness of the message. Given the tone of Evan's message I don't feel any great urge to help him any time soon. Mark - 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
-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
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