[CentOS] Apache Server Tuning for Performance

Tue Jan 20 19:20:04 UTC 2009
Jed Reynolds <lists at bitratchet.com>

linux-crazy wrote:
>      I want to  know about  the difference  between worker MPM and
> Prefork MPM , how to find out which one will be used by my apache
> server and  the recommended one   for highly loaded server.If some one
> provide me the link that best explains above two comparison also  be
> very use full.
>
>
>  Can any one guide me tuning to be  done for the maximum utilization
> of the Resources  and better performance of the Servers.
>   


Most list members would likely advise sticking with the prefork 
configuration.  Without knowing what kind of applications you are 
running on your webserver, I wouldn't suggest changing it.

Merely increasing the number of workers might make performance worse.

Use ps or top to figure out how much each apache worker is using. Then 
decide how much ram you want to dedicate on your server to Apache, 
without going into swap. (Over-allocating and then paging out memory 
will only make performance much worse.) For example, if I have 2G or 
ram, and I want 1.5 for apache workers, my average apache worker size 
(resident memory) is 65MB, then I have room for 23 workers. (1024 * 1.5 
) / 65. (There are more accurate ways to calculate this usage, like 
taking shared memory into account.)

Upgrading the ram in your web server is a pretty fast interim solution.

Consider your application performance, too. The longer a request in your 
application takes, the more workers are in use on your web server, 
taking up more memory. If you have long-running queries in your 
database, take care of those first.

Good luck

Jed