From: | "Matt Clark" <matt(at)ymogen(dot)net> |
---|---|
To: | "'Martin Foster'" <martin(at)ethereal-realms(dot)org>, "'John A Meinel'" <john(at)johnmeinel(dot)com> |
Cc: | <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: Restricting Postgres |
Date: | 2004-11-04 08:29:39 |
Message-ID: | 009701c4c248$6d5298e0$8300a8c0@solent |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-performance |
> I have a dual processor system that can support over 150 concurrent
> connections handling normal traffic and load. Now suppose I setup
> Apache to spawn all of it's children instantly, what will
...
> This will spawn 150 children in a short order of time and as
> this takes
"Doctor, it hurts when I do this!"
"Well, don't do that then..."
Sorry, couldn't resist ;-)
Our Apache/PG driven website also needs to be able to deal with occasional
large peaks, so what we do is:
StartServers 15 # Don't create too many children initially
MinSpareServers 10 # Always have at least 10 spares lying around
MaxSpareServers 20 # But no more than 20
MaxClients 150 # Up to 150 - the default 256 is too much for our
RAM
So on server restart 15 Apache children are created, then one new child
every second up to a maximum of 150.
Apache's 'ListenBackLog' is around 500 by default, so there's plenty of
scope for queuing inbound requests while we wait for sufficient children to
be spawned.
In addition we (as _every_ high load site should) run Squid as an
accelerator, which dramatically increases the number of client connections
that can be handled. Across 2 webservers at peak times we've had 50,000
concurrently open http & https client connections to Squid, with 150 Apache
children doing the work that squid can't (i.e. all the dynamic stuff), and
PG (on a separate box of course) whipping through nearly 800 mixed selects,
inserts and updates per second - and then had to restart Apache on one of
the servers for a config change... Not a problem :-)
One little tip - if you run squid on the same machine as apache, and use a
dual-proc box, then because squid is single-threaded it will _never_ take
more than half the CPU - nicely self balancing in a way.
M
From | Date | Subject | |
---|---|---|---|
Next Message | Markus Schaber | 2004-11-04 10:30:56 | Re: Avoiding explicit addDataType calls for PostGIS |
Previous Message | Tatsuo Ishii | 2004-11-04 08:09:25 | visiting Seoul, Korea |
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Huxton | 2004-11-04 08:32:08 | Re: index not used if using IN or OR |
Previous Message | Mario Ivankovits | 2004-11-04 07:55:50 | index not used if using IN or OR |