Tuesday, 10 September 2013

Tomcat async servlet perfromance

Tomcat async servlet perfromance

I've been experimenting with Tomcat 7's async servlet support and
comparing it to synchronous (plain) servlets on an EC2 m1.medium instance.
I've configured Tomcat to use the APR connector, and the service does some
(dummy) work for 80ms and returns an html response. I've configured Tomcat
to use the APR connector. I'm using Tomcat 7.0.42.
When the thread-pool size restriction has been removed, the synchronous
servlet spawned about 1000 threads and was able to handle up to about 2700
requests/sec while still maintaining reasonable latency. The asynchronous
servlet handled up to about 4500 requests/sec (I've used my own
thread-pool for the async processing rather than the container's
AsyncContext.start(Runnable) method).
While certainly significant (66% increase in request rate), I had expected
an even bigger difference between the async and sync servlets'
performance. Has other people's experience been the same? Are there any
major Tomcat configuration options that should be used when running async
servlets?

No comments:

Post a Comment