异常--Interrupting idle Thread

来源:互联网 发布:联想 知乎 编辑:程序博客网 时间:2024/06/09 17:40

今天遇到系统无法访问问题,检查日志异常如下。


异常信息

|WARNING|glassfish3.1.2|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=14;_ThreadName=Thread-2;|GRIZZLY0023: Interrupting idle Thread: http-thread-pool-28080(4).|#]


根据字面意思理解(Interrupting idle Thread)中断空闲的线程。网上摘取一段资料,https://www.java.net/node/703110

the interrupted message/warning itself is not a bug, it is just an indicator that HTTP request processing (Servlet execution) takes longer than expected (expectation is set by request-timeout setting). You can always disable this feature by setting request-timeout to -1 on an appropriate http-listener like [1]. The default timeout value is set to 15mins, it means one single servlet execution takes longer than 15mins! If this is ok - then just disable the timeout [1], if this is not ok - then there should be something wrong w/ the servlet/webapplication code.

大体意思是,一个servlet请求默认超时为15分钟,如果在高并发情况下,线程很多就会导致线程的堵塞,当达到线程开启上线的时候导致新线程无法开启。


嗯,有点意思了,根据这个资料,我对我的服务做了先调整,我用的是glassfish,调整了超时时间为5分钟,并且增加了最大线程数,如图,



再运行一段时间,看看还会不会再出现这个警告了。


个人分析,在高并发情况下,每个请求都相应缓慢,而且超时时间为15分钟较长,随着时间增加,服务线程数达到峰值,导致出现此类问题。


0 0
原创粉丝点击