回顾无响应的web应用程序的堆栈跟踪,我意识到一些数据与我的想法tomcat作品不匹配。等待对象监视器的“Tomcat Endpoint”是什么意思?
语境
该应用程序是击中快速连续一个缓慢的URL。这些请求似乎堆积如山,即在应用程序服务器中形成堵车。日志记录显示线程/ http连接器的数量已经最大(繁忙线程的数量已爬升至maxThreads值120)。
- 的Jboss 4.2.2
- 使用名为 'JBoss的,网络'
问题
许多线程都在 “做什么” 的Tomcat的6.0的变化 - 即从数据库中读取数据,写入输出流等...然而,超过50个线程“等待连接器提供新的套接字”(来自评论)
这对于非易失性存储器来说意味着什么,套接字编程器?
我之前的假设:错误
我曾以为,每个HTTP线程将“做自己的工作” - 获得请求,做了一些工作,并写出反应 - 不需要等待任何事情。
所以......
- 这是怎么回事?有人可以澄清socket-ish的东西吗?
- 这样的tomcat设置的瓶颈是什么意思?从Tomcat的org.apache.tomcat.util.net.JIOEndpoint(即增加此设置,降低一个等)
**堆栈跟踪**
"http-0.0.0.0-80-90" daemon prio=6 tid=0x695e1400 nid=0x24c in Object.wait() [0x6e8cf000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x09c34480> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
at java.lang.Object.wait(Object.java:485)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:416)
- locked <0x09c34480> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:442)
at java.lang.Thread.run(Thread.java:619)
Locked ownable synchronizers:
- None
代码片段
/** * Process an incoming TCP/IP connection on the specified socket. Any * exception that occurs during processing must be logged and swallowed. * <b>NOTE</b>: This method is called from our Connector's thread. We * must assign it to our own thread so that multiple simultaneous * requests can be handled. * * @param socket TCP socket to process */ synchronized void assign(Socket socket) { // Wait for the Processor to get the previous Socket while (available) { try { wait(); } catch (InterruptedException e) { } } // Store the newly available Socket and notify our thread this.socket = socket; available = true; notifyAll(); }
感谢