Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2008 11:58:30 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        =?ISO-8859-1?Q?Francis_Dub=E9?= <freebsd@optiksecurite.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC
Message-ID:  <E0956D53-6EA3-4E70-91B2-6606EA48869A@mac.com>
In-Reply-To: <49060AE0.3000301@optiksecurite.com>
References:  <49060AE0.3000301@optiksecurite.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 27, 2008, at 11:39 AM, Francis Dub=E9 wrote:
> I've read that this is mainly caused by Apache spawning too many =20
> processes. Everyone seems to suggest to decrease the MaxClients =20
> directive in Apache(set to 450 at the moment), but here's the =20
> problem...i need to increase it ! During peaks all the processes are =20=

> in use, we even have little drops sometime because there isn't =20
> enough processes to serve the requests. Our traffic is increasing =20
> slowly over time so i'm affraid that it'll become a real problem =20
> soon. Any tips on how I could deal with this situation, Apache's or =20=

> FreBSD's side ?

You need to keep your MaxClients setting limited to what your system =20
can run under high load; generally the amount of system memory is the =20=

governing factor. [1]  If you set your MaxClients higher than that, =20
your system will start swapping under the load and once you start =20
hitting VM, it's game over: your throughput will plummet and clients =20
will start getting lots of broken connections, just as you describe.

For a rough starting point, divide system RAM by httpd's typical =20
resident memory size.  If your load legitimately exceeds this, you'll =20=

need to beef up the machine or run multiple webserver boxes behind a =20
load-balancer (IPFW round-robin or similar with PF is a starting =20
point, but something like a Netscaler or Foundry ServerIron are what =20
the big websites generally use).

--=20
-Chuck

[1]: There can be other bottlenecks; sometimes poorly written external =20=

cgi-bin scripts or dynamic content coming from mod_perl, mod_php, etc =20=

can demand a lot of CPU or end up blocking on some resource (ie, DB =20
locking) and choking the webserver performance before it runs out of =20
RAM.  But you can run a site getting several million hits a day on a =20
Sun E250 with only 1GB of RAM and 2 x ~400MHz CPU.  :-)=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0956D53-6EA3-4E70-91B2-6606EA48869A>