Re: Swapping
by Kyle Dawkins other posts by this author
Oct 13 2003 3:02PM messages near this date
Re: Swapping
|
Re: Swapping
Mike
I'm pretty sure you're experiencing a standard problem that most of us=20=
have been bitten by at one stage or another. Ged is right when he says=20=
that 120 apache children at 40MB a pop will eat your RAM up. The piece=20=
of the puzzle that you're missing is this: due to the dopey VM code in=20=
Linux, when you run out of physical ram, processes get swapped out and=20=
at that instant, they become UNSHARED. In other words, if your process=20=
is taking up 40MB, of which 30MB is shared, and it gets swapped out, it=20=
will get swapped out as a 40MB process. When it gets swapped back in,=20=
it will take up 40MB of your precious RAM, and will probably force=20
another apache process to get swapped out and unshared, which will=20
cause another...
It's a tricky problem, but here's how you solve it:
You must, at ALL times, keep your machine from swapping out Apache=20
children. This is tricky. If you're running other things on your=20
machine, like a DB (I assume you're not since you say you're using=20
Oracle) then it becomes nearly impossible to prevent. But if your=20
machine is pretty much just Linux + Apache, you're OK: just make sure=20
that
MaxClients * LargestPossibleChildSize + AllRamUsedByOSAndOtherProcesses=20=
< 4GB
Since you're running a front-end Apache too, you need to figure that=20
into the equation. But the key here is that you can NEVER swap out an=20=
apache process, or you'll end up in the downward spiral of death, which=20=
seems to be what's happening to you. There's no recovery from that=20
unless you can stop apache; only other solution is to reboot. If=20
that's the case, you might as well be using Windows XP.
Hope this helps
Kyle Dawkins
Central Park Software
On Monday, Oct 13, 2003, at 05:34 US/Pacific, Mike Norton wrote:
> We are currently experiencing some problems with our mod_perl setup=20
> the server we are using is a Dual Xeon 2.4Ghz running Redhat AS 2.1,=20=
> 4GB Ram ,=A0Apache/1.3.27 (Unix) mod_perl/1.27. When the server is=20
> under=A0a heavy=A0load it all of a sudden consumes a large amount of =
swap=20
> and the server load shoots through the roof, the machine normally sits=20=
> quite happily not even touching the swap normally however it seems to=20=
> consume anything up to 3GB of swap all in one go. Does anyone have any=20=
> ideas on how to resolve this issue or why it happens ?
> =A0
> Thanks
> =A0
> Mike
Attachments:
unknown1
Thread:
Mike Norton
Ged Haywood
Kyle Dawkins
Perrin Harkins
|