java - Tomcat JDBC pool connections all stuck at Socket Read, and no new connection is created -
I have hosted on a Tomcat 7 application Amazon ElasticBeanstalk, and hosted on a MySQL 5.5 database Amazon RDS. The database server only serves a tomek application and its maximum connection limit is 10,000.
Although there are strange things happening on the DB connection after a few hours of uptime.
MySQL server reports that only 3 connections were created by the Tomcat JDBC connection pool, all of which were "sleep" (eg output):
| 228 | Root | IP-10-240-xx-xxx.ap- Southeast -2 compute.internal: 33270 | Xxxxx | Sleeping 13. | Faucet Tomcat reading thread dump suggest that all 3 connections (blocking) network IO socket have:
on java.net.SocketInputStream.socketRead0 (Native method) java.net.SocketInputStream.read (SocketInputStream.java:150) java.net.SocketInputStream.read (SocketInputStream.java:121) on com.mysql.jdbc.util.ReadAheadInputStream.fill (ReadAheadInputStream. java: 114) at com.mysql.jdbc.util.ReadAheadInputStream.read on Com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIf required (readAheadInputStream.java:161) (readAheadInputStream.java:189) - lock & lt; 0x00000000bc349cc0 & gt; (A com.mysql.jdbc.util.ReadAheadInputStream) only 3 DB connection in com.mysql.jdbc.MysqlIO.readFully (MysqlIO.java:3036) Because there is a connection pool And they are all stuck at reading the IO, Tomcat has denied any more HTTP requests that require DB data to serve
tomcat JDBC pool settings.
Mksaktive = "500" Mksidle = "100" Minidle = "50" Initialsize = "50" Makswait = "15000" Timebetveenvikshnrunsmillis = "10000" Minviktebleidletimemillis = "30000" Removeabndoned = "True" RemoveAbandonedTimeout = "120000" logAbandoned = "true" testOnBorrow = "true" testWhileIdle = "true" validationQuery = "select 1" driverClassName = "com.mysql.jdbc.Driver" factory = "org.apache.tomcat.jdbc. Still, it is unsure why all the readings of 3 DB connections stuck on the network Io, although considering the above configuration, I have an additional connection when all existing connections are busy. Make tomcat to make It is expected that much. I have 8 other beenstock applications us ing setup similar, although only this particular application has such weird pooling behavior and network Io problem.
Do you recommend that?
Thank you very much.
After the text "itemprop =" text ">
is suggested as on, you may have an unsafe thread problem.
Comments
Post a Comment