You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sri Kon <ra...@gmail.com> on 2012/07/10 19:45:40 UTC

App becomes sluggish - Tomcat 7.0.23

I have a web app (spring/hibernate) running on Tomcat 7.0.23. The symptom
is that after running for few days (4 to 5 days typically) the response
becomes very slow. The page that usually loads in 2 seconds takes anywhere
from 30 to 50 seconds. A restart brings the response back to normal (2
sec). I have taken thread dumps before and after. I see the thread in
question (which is taking longer time to respond) has a lock. Here is the
snippet.

  at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
    at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
    - locked <0x0000000799446298> (a
org.apache.tomcat.util.net.SocketWrapper)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

Upon looking into the code, there is a synchronized method and that
explains the lock. But, I am wondering if the locking is slowing the things
down  then why didn't it manifest from the fresh start and why only after
running for few days. Wondering where to look. Any clues? Thanks in advance.

Re: App becomes sluggish - Tomcat 7.0.23

Posted by Anurag Kapur <an...@gmail.com>.
To little info to say something concrete, but maybe there is a memory leak
in your app which manifests over days and causes slowness.

Best way to prove - take some heapdumps of monitor the heap using tools
like JConsole / PSI Probe when your app becomes sluggish (before you
restart). Maybe there are long and frequent GC pauses which go in vain as
there is no memory to collect.

Also, take some thread dumps when this happens again to see what they are
actually waiting on.

You can post the info from heap monitoring and thread dumps here if you
need help analyzing them.

Hope this helps.
--
Anurag Kapur

Twitter: @anuragkapur <http://www.twitter.com/anuragkapur>
AboutMe: http://www.anuragkapur.com

*Make a difference, donate for a wonderful cause..*
British 10k Page: http://www.justgiving.com/Anurag-Kapur-B10k-2012



On Tue, Jul 10, 2012 at 6:45 PM, Sri Kon <ra...@gmail.com> wrote:

> e) running on Tomcat 7.0.23. The symptom
> is that after running for few days (4 to 5 days typically) the response
> becomes very slow. The page that usually loads in 2 seconds takes anywhere
> from 30 to 50 seconds. A restart brings the response back to normal (2
> sec). I have taken thread dumps before and after. I see the thread in
> question (which is taking longer time to respond) has a lock. Here is the
> snippet.
>