pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Treat <xzilla@users.sourceforge.net>
To: pgsql-php@postgresql.org
To: peter.hofer@ics.at
Subject: Re: connection pool
Date: Tue, 1 Aug 2006 09:45:02 -0400
Message-ID: <200608010945.02939.xzilla@users.sourceforge.net> (raw)
In-Reply-To: <008d01c6b4da$5143b5e0$6515a8c0@ics2003.local>
References: <008d01c6b4da$5143b5e0$6515a8c0@ics2003.local>

On Monday 31 July 2006 15:48, Peter Hofer wrote:
> Hallo
>
> Need your help
>
> 1 got a Site runnig php 4.4.2 and postgresql (8.1.4) and
> Follwing problem
>
> - 4 Server (Apache) up to 300 clients connection to the DB
> - 1 DB machine
>
> So:
>
> - If I run with persisent, i got up to 1200 Connction and I run out
>   of memeory
>

one recommendation would be to set your max # of apache children to something 
less than the amount of connections you can handle on postgresql.   for 
example, if you can only handle 1000 connections, set the max # of children 
per server to say 245 (leave 20 slots for super user connections).  

one thing I do wonder about is just how much ram (or how little) you have 
available.  istm 1200 connections should not run you out of memory on a 
dedicated db machine. 

> - if I run with no persisent connection i got massive forking of postgres
>   (but less problems)
>

yeah... I often recommend not using persistent connections in php since they 
tend to cause trouble :-)

> How can I build up a Pool of Connections ?
>
> What about "Pgpool" ?
>

RIght... pgpool basically acts as an intermediary, so everything connects to 
the pool, which then forwards on requests to the database.  I would think 
reducing the number of apache children would work better, but this might be 
worth a shot since your mixing pg_connect and pg_pconnect between servers. If 
you do please report back your experience to the list :-)

-- 
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL



view thread (4+ messages)

Message-ID: <200608010945.02939.xzilla@users.sourceforge.net>
Permalink:  ../200608010945.02939.xzilla@users.sourceforge.net/
Also on:    postgresql.org/message-id/200608010945.02939.xzilla@users.sourceforge.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: xzilla@users.sourceforge.net, peter.hofer@ics.at
  Subject: Re: connection pool
  In-Reply-To: <200608010945.02939.xzilla@users.sourceforge.net>
  References: <008d01c6b4da$5143b5e0$6515a8c0@ics2003.local> <200608010945.02939.xzilla@users.sourceforge.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox