LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: LVS/Apache cluster freezes from time to time

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: LVS/Apache cluster freezes from time to time
From: "Jacob Coby" <jcoby@xxxxxxxxxxxxxxx>
Date: Fri, 31 Oct 2003 09:51:17 -0500
>  Disk I/O and load average
> are also available in `top`. Presumably they're being read from somewhere
> in /proc.

If you have sar installed, you can use it to see 10 min averages for disk io
and load average:

sar -B (for disk IO)
sar (for CPU)

sar -B should never go above 5 for pgpgin/s on a webserver for any extended
period of time, otherwise you're near the "swap of death."  I've had
webservers swapping so much that it was impossible to login from a local
term until I unplugged the network cable and waited a couple of minutes.

Another thing you can do is find your nominal memory usage for Apache
(assuming 1.x here, I don't know about 2.x).  Start up 'top' and look at the
SIZE and SHARE sizes of the httpd processes.  Take the average SIZE and the
average SHARE sizes, and do MEMnominal = SIZEavg - SHAREavg.  Then, to
figure out what MaxClients should be, do:

(SYSMEMtotal - SHAREavg - SYSMEMreserve) / MEMnominal = MaxClients

SYSMEMtotal is how much memory the server has available to apache.

SYSMEMreserve is how much memory you want to have free when you reach
MaxClients.  I like to keep at least 45mb, and 64mb+ is better.

And then, just to be sure, I take the MaxClients that I computed earlier and
subtract 10-15%.

It would be nice if Apache had a config option to set the minimum amount of
memory free to accept a new connection instead of the MaxClients setting.

-Jacob
Listingbook.com

<Prev in Thread] Current Thread [Next in Thread>