Jonathan wrote:
> I'm running prefork as such:
>
> StartServers 5
> MinSpareServers 5
> MaxSpareServers 10
> MaxClients 75

That says start 5 servers, I must have least 5 idle and no more then 10 idle.
You can simultaneously serve 75 clients.

> Using ab, I benched a page that has 3 db handles:
> session

I Assume you are you're using Apache::Session::Postgres,
I assume your passing DBH => $dbh, and LockDBH => $dbh,

Each apache child gets its own DBI connection from connect_on_init() if you are using it.


> benching 10 concurrent connections- no problem
> benching 100 concurrent connections- things seem fine for the first few
> hundred connections.
> around 400 though, i start getting DB errors.

Well only really 75 of them should be active at once the should queue according to your mpm... Which is probably
prefork, so they just sit in the parent waiting for a child to be free.


> if i do a quick "select * from pg_stat_activity " it shows me 198
> connections ( 2 reserved for admin )

I believe you should be at 75*2 = 150 asumming I read that correctly.

If you have Apache(2)::Reload on, you'll blow the Apache:BI handle
cache which I'll bet is your issue and the database will leave them open for $Timeout
and httpd will make new ones. The postgres max of 200 is then being triggered, capping you at 200.


HTH
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F 6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."