tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <>
Subject Re: very slow class loading on initial JSP/servlet request after restart
Date Fri, 20 Feb 2009 15:55:20 GMT
André Warnier wrote:
> Christopher Schultz wrote:
>> Hash: SHA1
>> Sam,
>> On 2/19/2009 6:23 PM, Sam Hokin wrote:
>>> The problem, which spontaneously appeared a few days before
>>> Christmas on
>>> this one server, is that the initial request of a JSP or servlet takes
>>> AGES to respond, usually exceeding several minutes.
>> Good... then you'll have plenty of time to /take a thread dump/ while
>> it's spinning its wheels.
>> I'll cast my hat into the ring: I suspect you're loading a resource that
>> wants to looking an external resource (like an XML file with a remote
>> DTD/Schema and validation is on in the parser) and the DNS is tripping
>> you up.
> I would like to point out at this moment that my initial analysis (the
> one with the reindeers) does not look so bad after all.
> More seriously, and for my own and possibly the OP's edification : we
> thus have 8 cores/cpus available, and one webapp being loaded at
> Tomcat startup, which takes ages, but independently of class
> compilation, Java and Tomcat versions etc..  Say we have told Tomcat
> to start 100 threads.
> Does that mean that possibly 8 threads (or more) are all (rather
> busily) waiting for something in relation to some initialisation in
> the (rather suspect) classes belonging to that webapp ?
> The OP also mentions "the initial request takes ages".  So this
> initialisation would not happen really at Tomcat startup, but at the
> first request.  Any particular setup or circumstance that could be
> tried to change when this happens, just to see ?

Sounds to me like the webapp is waiting for something external to
respond -- possibly from the network and timing out.  In my experience
there is usually some extra latency on the first request due to
compiling jsps, but I can't imagine it being significant -- especially
on a really good box w/ multiple cores.  It'd be interesting to start up
wireshark on the server and see if there is any network traffic sourced
out of tomcat during the several minute wait.  Maybe a firewall was
installed or reconfigured or some dependent resource was shutdown around


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message