pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sylvain Ross <jfk@fleming.u-psud.fr>
To: pgsql-php@postgresql.org
Subject: What is wrong with pg_pconnect() ?
Date: Mon, 15 Dec 2003 21:09:56 +0100
Message-ID: <IAEMIKOELLIGJPKPFJBOEECKCAAA.jfk@fleming.u-psud.fr> (raw)

Hi,

I read a few sites (including php.net, article about db persistent
connections) speaking about the adventage of pg_pconnect() php function...

I got a "big" problem with pconnections made with the pg_pconnect function.
The problem is the following :


I'm using a stable debian with:
apache 1.3.26
php 4.1.2
postgres 7.2

(I know some guys thinks those are old versions... no, it's just debian
stable versions ;))


So , here is the pb :

- A client connects for the first time to my httpd and load a script which
contain a pg_pconnect() call, what create a pgsql process... so far so good
...

- As my httpd is in keepalive mode (wiuth a keepalive_timeout of 15 secs),
if the user loads another page with an other pg_pconnect() call (with the
same parameters as the first pconnect()), it uses the same pgsql process
created before. Cool ! pconnect is great !

- BUT, when the keepalive times out, the dedicated apache process dies (what
is normal), BUT the pgsql thread is still alive ! with "idle" state !

Of course, since the related apache process has died, this idling pgsql
process will stay in memory for ever ! won't be reused ever !

I don't know how to deal with this ! If the pgsql forked-process where
killed when apache forked-process die, all should be OK ! but it does not :(


Tell me if there are any solutions...

Thanks in advance.

Sylvain




view thread (5+ messages)  latest in thread

Message-ID: <IAEMIKOELLIGJPKPFJBOEECKCAAA.jfk@fleming.u-psud.fr>
Permalink:  ../IAEMIKOELLIGJPKPFJBOEECKCAAA.jfk@fleming.u-psud.fr/
Also on:    postgresql.org/message-id/IAEMIKOELLIGJPKPFJBOEECKCAAA.jfk@fleming.u-psud.fr

 · 

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: jfk@fleming.u-psud.fr
  Subject: Re: What is wrong with pg_pconnect() ?
  In-Reply-To: <IAEMIKOELLIGJPKPFJBOEECKCAAA.jfk@fleming.u-psud.fr>
  References: <IAEMIKOELLIGJPKPFJBOEECKCAAA.jfk@fleming.u-psud.fr>

* 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