pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexey Borzov <borz_off@rdw.ru>
To: Hervé Piedvache <herve@elma.fr>
Cc: pgsql-php@postgresql.org
Subject: Re: pg_pconnect - Really persistent ?
Date: Wed, 6 Dec 2000 15:01:01 +0300
Message-ID: <1119521331.20001206150101@rdw.ru> (raw)
In-Reply-To: <3A2E22FC.2E1A2C01@elma.fr>
References: <3A2E22FC.2E1A2C01@elma.fr>

Greetings, Hervé!

Well, there are some problems, indeed.
1) PHP counts connections on a per-process basis. So, when you have,
say, 10 httpd processes, and a limit of 10 connections is set in
php.ini, you can have total of 100 postgres backends, with a default
limit of 32.
2) PHP does not reuse persistent connections when it can open a new
one. So set a limit of pconnections to 1 or 2 in php.ini, and
everything will work as intended.

At 06.12.2000, 14:43, you wrote:
HP> I have some troubles with the pg_pconnect function ...

HP> All my PHP scripts are using pg_pconnect but apache seems to not using
HP> the persistent connection ... ?
HP> I mean that when I make a small script usign a pg_pconnect, and a simple
HP> select ... I open 2 browsers and call many time my scrip, I look for the
HP> backends of postgresql and I see many backends opened !

HP> If I try for example to limit the backend to 35, and run an ab (apache
HP> bench) to call the page ... after the 35 connections opened postgresql
HP> say there is no more connection possible ... ok ! but why the
HP> persistents connexions are not re-used ?


-- 
Yours, Alexey V. Borzov, Webmaster of RDW





view thread (4+ messages)  latest in thread

Message-ID: <1119521331.20001206150101@rdw.ru>
Permalink:  ../1119521331.20001206150101@rdw.ru/
Also on:    postgresql.org/message-id/1119521331.20001206150101@rdw.ru

 · 

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: borz_off@rdw.ru, herve@elma.fr
  Subject: Re: pg_pconnect - Really persistent ?
  In-Reply-To: <1119521331.20001206150101@rdw.ru>
  References: <3A2E22FC.2E1A2C01@elma.fr> <1119521331.20001206150101@rdw.ru>

* 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