Re: pg_pconnect - Really persistent ?

From: Alexey Borzov <borz_off(at)rdw(dot)ru>
To: Hervé Piedvache <herve(at)elma(dot)fr>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: pg_pconnect - Really persistent ?
Date: 2000-12-06 12:01:01
Message-ID: 1119521331.20001206150101@rdw.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

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

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Aarmel 2000-12-08 07:25:14 persistant connections?
Previous Message Hervé Piedvache 2000-12-06 11:29:00 pg_pconnect - Really persistent ?