tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Performance Issue while upgrading from Embedded Tomcat 6 to Tomcat 7
Date Wed, 22 May 2013 14:00:46 GMT
Hash: SHA256


On 5/21/13 11:03 PM, Chirag Dewan wrote:
> I was monitoring the CPU utilization specifically. I can
> compromise on 10000 less transactions/sec,but 80-90% utilization is
> not good.

While it's nice to reduce resource utilization as much as possible,
why would you want your server to run at 25% CPU all the time? That's
a waste of 75% of the CPU available.

The test you are performing sounds like a peak-load test (100
simultaneous connections is pretty decent load). At peak load, you
have 10-20% breathing room before your CPU can't keep up. Sounds like
you have an appropriately-sized server for the type of load you expect.

Do you have some kind of performance benchmarks that you have to hit?

> I have configured 1000 max threads in the connector,and I am
> testing with 100 concurrent threads.

So you have 10 times the number of threads available than necessary.
Did you do that simply to make sure that the thread-pool wouldn't be
the problem?

What kind of connector are you using? Re-reading the thread it looks
like you are using the BIO (default) connector. I'm not sure switching
to NIO or APR would help raw throughput unless you are using SSL
(switch to APR) or have lots of dropped keepalive connections (switch
to NIO - or APR?).

> Well I tested a sample html page with Tomcat 6.0.18 and 7.0.30 on 
> Solaris x86 server. The req/sec were almost the same for both,but
> CPU utilization for Tomcat 6 was 23-27% and for Tomcat 7 it was
> 80-90% consistently.

What about Tomcat 6.0.37?

> On the other hand on a Linux system,the req/sec were a little
> higher in Tomcat 7 say 65k to 55k on tomcat 6 and the CPU
> utilization was the same for both 6 and 7.

... and what was that CPU utilization?

> My Jprofiler stack trace on Solaris is a lot different. As far as
> I have observed,for Tomcat 7 the stack Trace leads me to 
> ResponseFacade.setContentType,which was not the behaviour in
> Tomcat 6. Can that be a bottleneck?

See Mark's message: there have been some changes to how Tomcat
performs a setContentType -- because the string actually needs to be
parsed to see if there is a character encoding hiding in there, and
the output writer may need it's encoding changed.

You can see in the changelog
( this entry
under 7.0.33, which I think is the relevant part:
"The HTTP header parser added to address 52811 has been removed..."

Take a look at the references provided if you are interested in the
details. Otherwise, just upgrade to 7.0.40 and try again.

> Or is there something platform dependent that I should take care
> of?

There could be a bug in one of the JVMs, but this is fairly
well-exercised code that you are talking about.

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


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

View raw message