Jeremy Chadwick a écrit :
We're monitoring our swap with cacti, and we've never been swapping even
during high load because we dont let apache spawn enough process to do so.
On Mon, Oct 27, 2008 at 12:56:30PM -0700, Chuck Swiger wrote:
On Oct 27, 2008, at 12:38 PM, FreeBSD wrote:
With 4GB of RAM, you're less likely to run into issues, but the most
relevant numbers would be the Swap: line in top under high load, or the
output of "vmstat 1" / "vmstat -s".
You need to keep your MaxClients setting limited to what your system
can run under high load; generally the amount of system memory is the
governing factor.  If you set your MaxClients higher than that,
your system will start swapping under the load and once you start
hitting VM, it's game over: your throughput will plummet and clients
will start getting lots of broken connections, just as you describe.
According to top, we have about 2G of Inactive RAM with 1,5G Active
(4G total RAM with amd64). Swapping is not a problem in this case.
It would also be helpful to know what your httpd's are looking like in
terms of size, and what your content is like. For Apache serving mostly
static content and not including mod_perl, mod_php, etc, you tend to have
5-10MB processes and much of that is shared, so you might well be able to
run 400+ httpd children. On the other hand, as soon as you pull in the
dynamic language modules like perl or PHP, you end up with much larger
process sizes (20 - 40 MB) and much more of their memory usage is
per-process rather than shared, so even with 4GB you probably won't be
able to run more than 100-150 children before swapping.
Here's an example of top's output regarding our httpd process :
54326 apache 1 96 0 156M 13108K select 1 0:00 0.15% httpd
54952 apache 1 96 0 156M 12684K select 1 0:00 0.10% httpd
52343 apache 1 4 0 155M 12280K select 0 0:01 0.10% httpd
Most of our page are in HTML with a LOT of images. Few PHP pages, very
light PHP processing.
156M x 450 process = way more RAM than what we have (same for RES).
Concretely, how must I interpret these results ?
At the moment, the MaxClients isn't higher than the hardware can
support, but it will if i raise it again. I've gone through the Apache's
doc concerning high load tuning and did all that can be done on the fly
(without downtime). We were already planning to add another webserver
soon, but maybe not that soon :)
After checking multiple things (MySQL, networks, CPU, RAM) when a drop
occurs, we determined that everytimes there is drop, the number is
Apache's process is MaxClients (ps aux | grep httpd | wc -l) and the
new http request doesn't get answer from Apache (the TCP hanshakes
completes but Apache never push the data).
Yes, that aspect is going to be the same pretty much no matter what the
bottleneck is or how large you set MaxClients to. You will end up with
significantly better results (fewer drops, higher aggregate throughput)
if you tune appropriately than if you try to ramp MaxClients up further
than the available hardware can support.
You might find that checking out the URLs being most commonly listed in
http://yourdomain.com/server-status when you run into high load problems
will point towards a particular script or dynamic content which is
causing a bottleneck.
Thanks for the tips, i'll take a look at this.
Right ! I would really appreciate few explanation on this. Do the shared
pages counts as active or inactive RAM ? How can i calculate how much
physical RAM an apache process is taking ? How the VM works in this
regard ? ;)
One of the problems here is that the individual reporting the problem is
basing all of his conclusions on the first couple lines of top(1)
output, and is not bothering to look at per-process RSS or SZ. "I have
lots of Inactive RAM, so what's the problem!??!"
We should probably take the time to explain to the user the fact that
shared pages per process != amount of RAM that's been touched/used at
one point but is currently unused. Without someone explaining how the
VM works in this regard, he's going to continue to be confused and
correlate things which aren't necessarily related.
Thanks everyone !
email@example.com mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"