最近遇到个比较奇怪的问题,用户的网站百万级访问量,最近没有修改程序,也没有改过其他地方,最近总是运行20几个小时左右tomcat就假死一次,访问无响应!!经常过检查 日志发现 里面报了一个错误
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | com.alibaba.druid.pool.GetConnectionTimeoutException: loopWaitCount 0 , wait millis 60000 at com.alibaba.druid.pool.DruidDataSource.pollLast(DruidDataSource.java: 1076 ) at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java: 756 ) at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java: 644 ) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java: 4530 ) at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java: 659 ) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java: 4526 ) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java: 626 ) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java: 618 ) at com.sanyuan.dao.DBConnection.getConnection(DBConnection.java: 267 ) at com.sanyuan.dao.DBAccess.setPreparedSQL(DBAccess.java: 65 ) at com.clsoftware.sms.manager.SmsSenderLogManager.getTop1LogListByCondition(SmsSenderLogManager.java: 641 ) at org.apache.jsp.superadmin.sms.autoCheckInfor_jsp._jspService(autoCheckInfor_jsp.java: 72 ) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java: 70 ) at javax.servlet.http.HttpServlet.service(HttpServlet.java: 717 ) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java: 388 ) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 313 ) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java: 260 ) at javax.servlet.http.HttpServlet.service(HttpServlet.java: 717 ) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 290 ) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 206 ) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java: 413 ) at com.clsoftware.filter.MyFilterDispatcher.doFilter(MyFilterDispatcher.java: 162 ) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 235 ) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java: 206 ) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 233 ) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 191 ) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 127 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 102 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java: 109 ) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 291 ) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java: 190 ) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java: 291 ) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java: 776 ) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java: 705 ) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java: 898 ) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java: 690 ) at java.lang.Thread.run(Thread.java: 619 ) |
loopWaitCount 0, wait millis 60000 一看字面意思就是数据库有问题了....找了N久才发现不是数据库的问题...
原来用户用了数据库连接池,由于我们的诶个虚拟主机都有数据库并发的限制,用户把数据库连接池最大连接数设置为50 , 造成了数据库连接池不够用,通知用户,增加数据库连接池后,重启tomcat恢复正常!!