응답이없는 웹 응용 프로그램의 스택 추적을 검토 한 결과, 일부 데이터는 어떻게 생각했는지와 일치하지 않음을 알았습니다."Tomcat Endpoint"Waiting On Object Monitor의 의미는 무엇입니까?
상황은
응용 프로그램이 느린 URL을 연속해서 타격을 받고있다. 이러한 요청이 쌓여서 앱 서버에 교통 체증을 일으키는 것으로 보입니다. 로깅은 스레드 수/http 커넥터가 최대 값을 초과했음을 나타냅니다 (사용중인 스레드 수가 maxThreads 값인 120까지 올라갔습니다).
- 제이 보스 4.2.2
- 은 '제이보스 - 웹'
질문을
스레드의 대부분은 "뭔가를하고"있다라고 바람둥이 6.0의 변형을 사용합니다 - 즉 데이터베이스에서 읽기, 출력 스트림에 쓰기 등등. 스레드 중 50 개 이상은 "새 소켓을 제공하기 위해 커넥터에서 대기 중"입니다 (주석에서)
정확히 비 - 소켓 프로그래머? - 응답을 요청을 얻을 몇 가지 작업을 수행하고 쓰기 - 그리고 하지 필요
잘못된 나는 각 HTTP 스레드가 '자신의 일을'것이라고 가정했다 :
내 전 가정
아무것도 기다리지.그래서 ...
- 을 무슨 일이야? 누군가가 소켓 같은 것을 분명히 할 수 있을까요?
- 바람둥이 설정에 어떤 병목 현상이 있습니까? 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();
}
감사