tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Designing for Load on TomCat
Date Sat, 04 May 2013 12:07:45 GMT
yogesh hingmire wrote:
> While planning / designing to build a web app that must scale to 2000
> concurrent users, distributed across 5 Tomcat nodes in a cluster, Apache at
> the front of course and the ability to serve 20 concurrent requests per
> seconds during business hours, with a page response time of 5 seconds, how
> would we go about the ask ? What Apache / Tomcat / System (CPU/JVM)
> parameters should be considered for this design ?

I will provide the ABC, and leave the details for someone else.
You have 20 requests arriving per second, and it takes 5 seconds to process one request 
and return the response.
So, over time, it will look like this

Time   new requests   requests in-process  requests terminated

0        20              20                      0
+1s      20              40                      0
+2s      20              60                      0
+3s      20              80                      0
+4s      20             100                      0
+5s      20             100                     20
+6s      20             100                     40
+7s      20             100                     60

So, in principle, and assuming nothing else is going on, you need 100 concurrent threads 
in Tomcat to process these requests.
(I would take a healthy margin of security and double that).
Whether for that you need a cluster of Tomcats is another discussion.
And how much memory you need to allocate to your Tomcat(s) JVM(s) is a function of what 
your webapp needs, to process one request.

The numer of concurrent users should be relatively irrelevant, if all you mean by that is

that some of these requests come from the same user, but they are otherwise independent of

one another.

Note that I have a suspicion that what you describe as "requests" above probably only 
count the requests to your webapp code, and do not count the additional requests for 
stylesheets, images, etc.. which may be embedded in any page that the user's browser 
eventually displays.
So unless you plan on serving those directly from the Apache httpd front-end, you should 
take them into account too.

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

View raw message