-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Douglas,
In addition to what Filip posted... On 6/11/15 12:18 PM, Douglas Schaible wrote: > Good Day All, > > I am having a problem with a connection pool and I was hoping for > some guidance. > > I have defined the connection pool below for two deployed > applications to use. When I bounce the server I can see that it > immediately crates 100 connections to the DB. (I am ok with this, > but that is not what is specified in the config). When you start your application, does it load a bunch of stuff from the database? If you are fetching lots of connections and not returning them, you may see your connection count go up to 100 (the maxTotal value). > Then when I access the application repeatedly very quickly new > connections to the DB are created each time a page is called till > it reaches about 150 and then future calls fail with the message > "com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: > > > Too many connections” logged by the server. I would have expected the pool to stop handing-out connections at 100. But, if you don't have removeAbandoned and you aren't returning the connections properly, then the pool is full of connections that can't be used. > If we don’t place any extra load on the server the number of > connections to the DB are reduced to 1 or 2 after 24 hours and you > get the error "Timeout: Pool empty. Unable to fetch a connection > in 30 seconds, none available[size:100; busy:100; idle:0; > lastwait:30000].” from one of the applications and the other > application continues to work just fine. The other application likely is using a different pool. Where is that <Resource> defined? > I believe that the DB, MySQL, is dropping the connection, but > tomcat does not know that it has been dropped. > > I am looking for some guidance on how to tune this configuration. > Any suggestions? > > > <Resource name="jdbc/PDB" auth="Container" > type="javax.sql.DataSource" > factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" > initialSize="10" maxTotal="100" maxIdle="5" maxWaitMillis="10000" > username=“xxxxxx" password=“xxxxxx" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://xxxxx.xxxxxx.us-east-1.rds.amazonaws.com”/> Your error message says "Unable to fetch a connection in 30 seconds", but your maxWaitMillis is 10000 (10 seconds). Are you sure this is the configuration being used? - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJVe0oJAAoJEBzwKT+lPKRYqIYP/Rk23OUojZFYjhxMBzan18hV KcT2znvisAupRth5zEKiHwABEDwhhy4YZiexyVmiixR91HuAtoI0PpvuhKs8j2uM h1a+sdwWfgZz/PapiGr4FgXc0TlAc84RRlEG//5APeHkyQfE2XiCCwhkW7Q2hP3u pcRirzbXbSnftwXAMCTdrr5p37bpO2pCFMxcw3lCk7galAatrfGg05mGWw8NbkTD vL6iLepzK7krtk1QZskCRZ2TXRJ5H8UQjXMraLf8CEMxreP4gL9PNwLSUv2gCxrg Gn0TAVagjYtTvBObVYZUrNQ0f97t3IMtwy1bfyXTxBul6pwSXiv9L9B2p63YDO6t A13qjn3JJ4b3nkIm+ikejEkQdu1dVS+sNOlp2zKDV31wiMXQEHPIt5cUo8gmkI/O 3RagTmCMQO8w/OaC96+vIAgHrnEeq+1bANpbGfghQHcwObwmJ3OeMFte7YvwlBBP zaECgLOsNMHhvvllO3UrY2jEI6OQomE4FReuCr76txi0F6EdvHTO3OsVKL0Sz4Bd 6L7OdpBSvENRNMpXWLSoyFdkm0HOmoA+HW7wJtCG5B06YXJO7RgHTkBk/3HQ0tIi YUG661S4GkObOg0FEHYJshlvHmb9lOYVRlHqqlBut8hXoZrTlW3ac3Hk5Qb0d6Dh zpbhalTCHqsbaR66OT3n =4vP4 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org