Re: pg_pconnect - ??

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: Chris Ruprecht <chrup999(at)yahoo(dot)com>
Cc: PostGreSQL PHP Group <pgsql-php(at)postgresql(dot)org>
Subject: Re: pg_pconnect - ??
Date: 2002-01-28 19:19:57
Message-ID: 3.0.6.32.20020128141957.02130660@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

The connection will only be reused if the *same* apache child process
handles the request. You should expect to see many postgres client
connections.
A) Each database/user connection combination.
B) Each apache child process

Multiply A*B to get max number of concurrent connections. If A*B can go
over postgres connection limit, then you might start getting connection
refused messages.

If your postgres database is on the same server as you webserver, there is
neglible gains for using pconnect over connect.

Frank

At 09:56 AM 1/28/02 -0600, Chris Ruprecht wrote:
>Hi all,
>
>I am under the assumtion that, when I do a pg_pconnect instead of a
>pg_connect, the connection to the db I have established, can be used
>by another PHP procedure. Somehow, I don't see this working the way I
>expect it.
>When I initially connect with pconnect, I see a postgres session
>staring up and everything works. The postgres process stays active
>but when I pconnect again, a second process is started. I was
>expecting that the same process from the first pconnect will be used.
>At the end, I land up with a whole bunch of postgres client sessions
>hanging around in the system, doing who knows what.
>
>What am I missing (doing wrong) here?
>Postgres = 7.1.3, OS = Linux 2.4.9 (RedHat 7.2), PHP = 4.0.6, Apache
>= 1.3.22, memory = plenty (768 MB)
>
>Best regards,
>Chris
>--
>Chris Ruprecht
>Network grunt and bit pusher extraordinaíre
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Mitch Vincent 2002-01-28 19:56:59 Re: pg_pconnect - ??
Previous Message Chris Thompson 2002-01-28 16:51:17 Re: pg_pconnect - ??