tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: Errant slow request
Date Sun, 05 Sep 2010 16:49:20 GMT
On 05/09/2010 03:19, Kevin wrote:
>  Hi, I'm using Apache Bench (ab) to send 1,000 requests with a
> concurrency of 500 to a simple servlet on Tomcat trunk (revision 992708,
> 2010-09-03) which uses request.startAsync() and
> Executors.newFixedThreadPool(10) to do the work and return a few bytes
> of response and asyncContext.complete().
> 
> What I'm noticing is that every once in a while there is an errant
> request that takes up to 10 seconds, while the average is around half a
> second. I've reproduced this on both Oracle and IBM JVMs. I've looked at
> verbosegc and see no anomalies in pause times or heap usage. I've taken
> javadumps and I don't see any thread that is obviously "stuck" anywhere.
> Most importantly, if I compare this to a servlet that writes the same
> bytes but synchronously (i.e. a "classic" servlet service() method),
> then I don't see this aberration.
> 
> I can see these long requests in my access log by changing
> org.apache.catalina.valves.AccessLogValve to "%h %l %u %t &quot;%r&quot;
> %s %b %D", e.g.:
> 
> 127.0.0.1 - - [04/Sep/2010:18:46:20 -0700] "GET /myapp/ HTTP/1.0" 500
> 207 10986
> 127.0.0.1 - - [04/Sep/2010:18:46:22 -0700] "GET /myapp/ HTTP/1.0" 500
> 207 10428
> 127.0.0.1 - - [04/Sep/2010:18:46:22 -0700] "GET /myapp/ HTTP/1.0" 500
> 207 10347
> 
> My question is: how do I debug these 500 errors?

Which OS are you using?

One of the (non-access) log files in tomcat/logs might have a stacktrace
in it.

If not, then you might need to configure an UncaughtExceptionHandler,
set on a thread when it's created in a ThreadFactory - which you can
supply as a parameter to most Executors.newXXXXXThreadPool methods.


p


> Thanks.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


Mime
View raw message