tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: It¡¯s amazing, apache make TC performance decrease dramatically.
Date Fri, 06 Jun 2008 16:27:27 GMT
Zufeng Huang wrote:
>   My steps:

General remarks: Make sure, that you understand the bottlenecks of your 
test runs x.1 and x.2. E.g. is one of them slower, because it saturated 
available network bandwith, or is it slower, because there are not 
enough threads in the AJP connector's thread pool. The best bottleneck 
to get is completely saturated CPU.

Your ab runs on a different system?

>   1, Using a jsp as the target ONE.
>   1.1, ab ¨Cn 25000 ¨Cc 1000 URL_via_apache
>   Concurrency Level:      1000
>   Time taken for tests:   410.105255 seconds
>   Complete requests:      25000

This is very bad throughput! Using the default thread count on the AJP 

Try with concurrency 1 and then do a couple of runs with increasing 
concurrency to study the behaviour.

I would expect latency to go up, especially for trivial dynamic content 
and static content, but I would not expect to get a huge decrease in 
throughput, as long as you add enough CPU resources for the additional 
httpd overhead. You can approximate the relative CPU overhead by 
measureing CPU needed with concurrency one (and enough requests to 
produce mesurable CPU times).

In general, since latency goes up, you would also need higher 
concurrency for the optimal throughput with httpd/Tomcat instead of 
Tomcat standalone. In your case I expect concurrency 1000 to be beyond 
the optimal point for 1.1 and 1.2. Usually you start by defining some 
throughput goal (e.g. in requests per second) and you increase 
concurrency until you get the best throughput. If it is above your 
requirement, and the response times are good enough, you are done.

>   1.2,ab ¨Cn 25000 ¨Cc 1000 URL_direct_to_tomcat
>   Concurrency Level:      1000
>   Time taken for tests:   12.297322 seconds
>   Complete requests:      25000
>   2, Using a html page as the target TWO.
>   2.1, ab ¨Cn 25000 ¨Cc 1000 URL_via_apache
>   Concurrency Level:      1000
>   Time taken for tests:   25.655253 seconds
>   Complete requests:      25000
>   2.2, ab ¨Cn 25000 ¨Cc 1000 URL_direct_to_tomcat
>   Concurrency Level:      1000
>   Time taken for tests:   24.132493 seconds
>   Complete requests:      25000

The numbers are so close, that I would expect, that both solutions did 
not saturate your CPU and you reached some other bottleneck, like 
network bandwith, the ability of ab to handle client requests, or the 
number of TIME_WAIT connetions in your tcp connection hash.

Did you use http keep-alive?

>   1, According to my configurations, apache(2.2.4) has NO advantage against tomcat(5.5.15)
in processing static content.

I'm not sure, if your measurement shows that. But I wouldn't argue for 
httpd because of performance reasons. For me it is more the 
configuration flexibility, which makes it very powerful in complex 
integration scenarios.

>   2, In processing dynamic content, apache make performance decrease dramatically.

Performance in terms of latency: yes for fast requests.
Performance in terms of throughput: in my experience no, if you add some 
CPU ressources and do good sizing.

>   It¡¯s the matter of MPM-prefork/worker???

In general prefork should be fine for performance, because it is less 
complex than worker. But prefork needs slightly more ressources. So make 
sure, that you have enough memory for your more than 1000 httpd children.

>   FYI: 
>   <IfModule prefork.c>
>   StartServers 50
>   MinSpareServers 50
>   MaxSpareServers 100

Your test run is a little short in order to make startup of 900 
additional processes neglectable, at least once your httpd/Tomcat 
combination is close to the Tomcat performance. So increase 
MaxSpareServers to 1000 and make sure, that you do some test run before 
doing the one you are taking your results from.

>   ServerLimit 2000
>   MaxClients 1500
>   MaxRequestsPerChild 0
>   </IfModule>
>    ------------------------------
>   maxThreads="1500" minSpareThreads="20" maxSpareThreads="50"
>   enableLookups="false" redirectPort="8443" acceptCount="300"

Also in your AJP connector?

Are httpd and Tomcat on the same system?



To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message