On Wed, 2009-05-20 at 19:28 -0600, si...@allumezinfotech.com wrote:
> This is pretty cool explanation .. thanks so much and absolutely my bad
> this particular thing of port 80 should be asked in tomcat user group ;)
> 
> But any thoughts on handling of load for tommcat and apache in this case :
> 2500 hits / min.

There is no straight forward way of answering this as the number of
hits/min is meaningless without an understanding of the work required to
achieve a single hit.

For example, if each hit is served from memory cache, by fast clients,
where each request only takes 0.001s to serve from start to finish, then
you would only need a few worker processes, as each worker would be
relatively uncontended.

If on the other hand, each request takes 3 seconds to complete, maybe
due to having to contact a remote WS, go to the DB, whatever, then you
would need many more worker processes.

In an ideal situation, you would manage the number of workers to allow
enough spare workers to handle your load. You can monitor this with most
web servers/application servers, in apache you would use
mod_server_info.

However, it is not that simple (nothing is). By increasing the number of
workers, you increase the potential load on your server. You also need
to monitor your load, and not allow your server to spawn too many
workers. You can monitor this in many ways, depending on your server
OS. 

Finally, you have to take into account how scalable the resources you
are using are. For instance, if you use a database, it needs to be able
to cope with handling simultaneous queries from the maximum number of
workers your app/server is configured to use. Even if you are doing
something relatively 'minor' (say, load a template from disk and
transform it with some info from the request), you need to check that
you can load that many templates from disk simultaneously. Obviously, in
that last example you could obviate the need to load from disk by
caching the template.

If your app feels 'slow' after increasing the number of workers
available to it, or has a measurable increase in processing time, then
it is a fair indication that your resources are not scaling effectively.

This advice is all generic web application tuning, and applies to any
web or app server. Specifically for apache though, in the prefork MPM,
you control the initial number of workers with ``StartServers'', the
maximum number with ``MaxClients'' and you control how it ramps between
the two with ``MinSpareServers'' and ``MaxSpareServers''. 
For other MPMs, those directives have slightly different meanings, so
always check the manual for both the directives and the MPM you are
using.

Cheers

Tom


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to