How to handle missing pgsql.connect_timeout

From: Janning Vygen <vygen(at)gmx(dot)de>
To: pgsql-php(at)postgresql(dot)org
Subject: How to handle missing pgsql.connect_timeout
Date: 2005-02-01 08:38:17
Message-ID: 200502010938.17853.vygen@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hi,

i use persitent connections and limit them for example to
pgsql.max_persistent = 32

if all connections are in use a new http call to my script's pg_pconnect
results in waiting for a free slot. That's fine, because usually a slot is
getting free within a second.

But if my server is much more overloaded and it would take more than 5 seconds
to wait for a free slot it doesnt make sense to wait, because the user would
hit stop anyway without getting a serious error message.

it would be nice to have a timeout value after which pg_pconnect returns with
an error, so could show a nice error page telling the user to try again in a
few minutes.

i found the php directive mysql.connect_timeout which does exactly what i
want. There is no such directive for pgsql.

I tried pgpool searching in pgpool for a connection timeout directive, but i
didn't found one.

It would be so nice to have a timeout of 3 seconds and after it display an
error message to the user instead of let him waiting and waiting.

Does anybody has any hints to solve this problem?

kind regards
janning

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Christopher Murtagh 2005-02-01 13:18:36 Re: How to handle missing pgsql.connect_timeout
Previous Message Michael Fuhr 2005-01-24 17:44:35 Re: to_char replacement