aspose file tools*
The moose likes Tomcat and the fly likes How to resolve the Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to resolve the "All threads (500) are currently busy" issue in Tomcat." Watch "How to resolve the "All threads (500) are currently busy" issue in Tomcat." New topic
Author

How to resolve the "All threads (500) are currently busy" issue in Tomcat.

Kumara Swamy
Ranch Hand

Joined: Nov 17, 2008
Posts: 34
In my tomcat server(5.5.17) i used to get the following error message:
All threads (500) are currently busy, waiting. Increase maxThreads (500) or check the servlet status

How to resolve this issue?


Regards,
Kumara Swamy.
Kumara Swamy
Ranch Hand

Joined: Nov 17, 2008
Posts: 34
Please help me out to fix the issue.

Regards,
Kumara Swamy.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

Increase the maxThreads setting and make sure you have the hardware to support it.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
Do you really have 500 users accessing the system concurrently? Or is there something that prevents threads from terminating correctly?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

You know, I never thought to question that (being used to applications with thousands to tens of thousands of simultaneously users being the norm.)
Kumara Swamy
Ranch Hand

Joined: Nov 17, 2008
Posts: 34
Bear Bibeault wrote:Increase the maxThreads setting and make sure you have the hardware to support it.


Hi,
We can the thread size but the problem is i dont know how to balance the configuration settings with hardware availability.
Please help me out to find how to configure the server efficiently?


Do you really have 500 users accessing the system concurrently? Or is there something that prevents threads from terminating correctly?


No there might be below 50 users at that time, but still we are getting the error.
Here is the some part of thread dump which was taken at the time of error.


Full thread dump Java HotSpot(TM) Server VM (1.5.0_02-b09 mixed mode):

"http-80-Processor887" daemon prio=1 tid=0x08b65c98 nid=0x7350 in Object.wait() [0x68d6f000..0x68d70130]
at java.lang.Object.wait(Native Method)
- waiting on <0x7da5dfa0> (a org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Object.wait(Object.java:474)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:656)
- locked <0x7da5dfa0> (a org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Thread.run(Thread.java:595)

"http-80-Processor862" daemon prio=1 tid=0x580bc2f0 nid=0x7337 waiting for monitor entry [0x56b71000..0x56b71db0]
at java.sql.DriverManager.getConnection(DriverManager.java:158)
- waiting to lock <0x6f02b2a0> (a java.lang.Class)
at com.panterranetworks.james.db.JamesMysqlConnection.getConnection(Unknown Source)
at com.panterranetworks.james.JamesMailClient.getInbox(Unknown Source)
at org.apache.jsp.messenger.smspull_jsp._jspService(smspull_jsp.java:73)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

"http-80-Processor861" daemon prio=1 tid=0x580bb688 nid=0x7336 runnable [0x67dd0000..0x67dd0e30]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:737)
at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:398)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:827)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
"http-80-Processor1" daemon prio=1 tid=0x6b1f37e0 nid=0x5b6a runnable [0x6a6fe000..0x6a6ff030]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:737)
at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:398)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:827)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

"ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon prio=1 tid=0x6a1f9a90 nid=0x5b69 waiting on condition [0x6b2fe000..0x6b2ff0b0]
at java.lang.Thread.sleep(Native Method)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1547)
at java.lang.Thread.run(Thread.java:595)

"Low Memory Detector" daemon prio=1 tid=0x6da028a0 nid=0x5a4e runnable [0x00000000..0x00000000]

"CompilerThread1" daemon prio=1 tid=0x6da01480 nid=0x5a4c waiting on condition [0x00000000..0x6d97d058]

"CompilerThread0" daemon prio=1 tid=0x6da004c0 nid=0x5a4b waiting on condition [0x00000000..0x6d9fe0d8]

"AdapterThread" daemon prio=1 tid=0x0886aff0 nid=0x5a48 waiting on condition [0x00000000..0x00000000]

"Signal Dispatcher" daemon prio=1 tid=0x0886a088 nid=0x5a46 runnable [0x00000000..0x00000000]

"Finalizer" daemon prio=1 tid=0x088605d0 nid=0x5a42 in Object.wait() [0x6decf000..0x6ded0030]
at java.lang.Object.wait(Native Method)
- waiting on <0x727b8130> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
- locked <0x727b8130> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=1 tid=0x0885e778 nid=0x5a40 in Object.wait() [0x6df50000..0x6df510b0]
at java.lang.Object.wait(Native Method)
- waiting on <0x72675380> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:474)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0x72675380> (a java.lang.ref.Reference$Lock)

"main" prio=1 tid=0x087aa8e8 nid=0x5a34 runnable [0xbff26000..0xbff27028]
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
- locked <0x769a9fa8> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:388)
at org.apache.catalina.startup.Catalina.await(Catalina.java:615)
at org.apache.catalina.startup.Catalina.start(Catalina.java:575)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

"VM Thread" prio=1 tid=0x0885bb10 nid=0x5a3e runnable

"GC task thread#0 (ParallelGC)" prio=1 tid=0x08830be8 nid=0x5a38 runnable

"GC task thread#1 (ParallelGC)" prio=1 tid=0x08831448 nid=0x5a3a runnable

"GC task thread#2 (ParallelGC)" prio=1 tid=0x08831878 nid=0x5a3b runnable

"GC task thread#3 (ParallelGC)" prio=1 tid=0x08832080 nid=0x5a3c runnable

"VM Periodic Task Thread" prio=1 tid=0x6da03e40 nid=0x5a4f waiting on condition



Regards,
Kumara Swamy.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
at java.sql.DriverManager.getConnection(DriverManager.java:158)
- waiting to lock <0x6f02b2a0> (a java.lang.Class)


That suggests the bottleneck has to do with database connections. Are you using a connectin pool?

Bill
Kumara Swamy
Ranch Hand

Joined: Nov 17, 2008
Posts: 34
That suggests the bottleneck has to do with database connections. Are you using a connectin pool?


Hi,
We are not using the connection pool at all but still we are getting the error.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

Kumara Swamy wrote:
That suggests the bottleneck has to do with database connections. Are you using a connectin pool?
We are not using the connection pool at all but still we are getting the error.

That's likely the issue. You should be using a connection pool.
Kumara Swamy
Ranch Hand

Joined: Nov 17, 2008
Posts: 34
That's likely the issue. You should be using a connection pool.


Hi,
I would look into the possibility of implementing the connection pool.
Thanks for the help.

Regards,
Kumara Swamy.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to resolve the "All threads (500) are currently busy" issue in Tomcat.