From: Hervé Piedvache <herve@elma.fr>
To: Alexey Borzov <borz_off@rdw.ru>
Cc: pgsql-php@postgresql.org
Subject: Re: pg_pconnect - Really persistent ?
Date: Mon, 11 Dec 2000 10:46:08 +0100
Message-ID: <3A34A260.BB0E1490@elma.fr> (raw)
References: <3A2E22FC.2E1A2C01@elma.fr>
<1119521331.20001206150101@rdw.ru>
Hi Alexey,
Alexey Borzov a écrit :
>
> 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.
OK .. I would like more precision of your configuration please, or to
configure my system ...
I do what you said ... but still have trouble with postgresql ... I have
a message like too many files opened in same time ... on the postgresql
server my max limit is 8192 files ... !! So to save my trouble for the
moment the only way I found is to cron a apache graceful each minute !
:(((
Each time the graceful is done it kill all the backends of postgresql
not needed ... then I'm saved !
But I think it's not the good solution so what do I have to limit ?
Apache ? Postgresql ? my limit of pconnection and connection (pconnect
and normal) is now set to 2 in my php.ini file.
For the moment on apache :
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 10
#
StartServers 20
MinSpareServers 64
MaxSpareServers 128
MaxClients 256
MaxRequestsPerChild 0
ThreadsPerChild 256
LimitRequestBody 50240
LimitRequestFields 50
#
I run postgresql with those options :
-B 1024 -S -i -N 256 -o '-F -E -S 1000 -d 1 -s -o
/usr/local/pgsql/data/postgres.log'
I have 2 servers, one for Apache, the other for postgresql the two
servers are identical configuration with 2xPIII 800 SMP, 1Gb of RAM.
My web server have many connections ... and each connection need to
access to the postgresql !
Hope you could give me some help to solve this stupid trouble !! ;)
Regards,
> 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
--
Hervé
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: herve@elma.fr, borz_off@rdw.ru
Subject: Re: pg_pconnect - Really persistent ?
In-Reply-To: <3A34A260.BB0E1490@elma.fr>
References: <3A2E22FC.2E1A2C01@elma.fr> <1119521331.20001206150101@rdw.ru> <3A34A260.BB0E1490@elma.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