How to handle missing pgsql.connect_timeout - Mailing list pgsql-php

From Janning Vygen
Subject How to handle missing pgsql.connect_timeout
Date
Msg-id 200502010938.17853.vygen@gmx.de
Whole thread Raw
Responses Re: How to handle missing pgsql.connect_timeout
List 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





pgsql-php by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: to_char replacement
Next
From: Christopher Murtagh
Date:
Subject: Re: How to handle missing pgsql.connect_timeout