Reputation: 131
After receiving a request, the http thread keeps busy during 60 seconds. Using JConsole, I can see that, during this time, threads stay on:
State: RUNNABLE
Stack trace:
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:150)
java.net.SocketInputStream.read(SocketInputStream.java:121)
org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:721)
org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:359)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:821)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:508)
org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:806)
org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:826)
java.lang.Thread.run(Thread.java:722)
org.jboss.threads.JBossThread.run(JBossThread.java:122)
Why is this? Shouldn't a thread be used and released immediately? This is impacting my server on peak time causing long waits.
Someone can explain me this behavior and how can i disable it or reduce the 60 seconds time?
Thank you all, Best regards
Upvotes: 0
Views: 1600
Reputation: 200138
Your thread is blocking on a socket read operation. Since you are using Java's blocking socket I/O, each connection in the HTTP connection pool must have such a thread associated with it, waiting for a new request.
The solution is to decrease the idle timeout in the HTTP connection pool.
Upvotes: 1