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

From Janning Vygen
Subject Re: How to handle missing pgsql.connect_timeout
Date
Msg-id 200502020949.21251.vygen@planwerk6.de
Whole thread Raw
In response to Re: How to handle missing pgsql.connect_timeout  (Christopher Murtagh <christopher.murtagh@mcgill.ca>)
Responses Re: How to handle missing pgsql.connect_timeout
List pgsql-php
Am Dienstag, 1. Februar 2005 18:10 schrieb Christopher Murtagh:
> On Tue, 2005-02-01 at 17:40 +0100, Janning Vygen wrote:
> > Am Dienstag, 1. Februar 2005 14:18 schrieben Sie:
> > > On Tue, 2005-02-01 at 09:38 +0100, Janning Vygen wrote:
> > > > Does anybody has any hints to solve this problem?
> > >
> > >  This is a bit of a non-solution, but it is what worked for us. We
> > > simply stopped using pconnect() altogether. This seemed to have solved
> > > connection timeouts and delays. Our site gets 500k page hits per day
> > > without any problems.
> >
> > hm. i didn't get the point. Do you mean you don't use persistent
> > connections just plain pg_connect instead of pg_pconnect??
>
>  Exactly. pg_pconnect() is (or was the last time I tried it) broken in
> PHP.

It's not broken anymore! And it speeds up your website.

> We were constantly getting connections that wouldn't close, and
> sometimes not time out. Ever since we gave up on them, we've had no
> problems.

Thats not exactly my problem. I just want to have say

20 MaxClients to wait for http Connections
but only 5 possible DB Connections

I http server no. 6 tries to connect i want pg_pconnect (or pg_connect; that
doesn't matter) to wait maximal 1 second and then return an error.

At the moment it waits "forever" (until max_execution_time i guess) and you
have no chance to show an error message like: DB is overloaded, please try
again.

php_pgsql module doesn't have a directive like mysql which is
mysql_connection_timeout.

i tried pgpool but it doesn't have a timeout value for establishing a
connection.

That's my problem. My DB is overloaded once a week to a special peek time and
i can't afford more hardware. I just want a simple and kind error message.

kind regards
janning

pgsql-php by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: to_char replacement
Next
From: Janning Vygen
Date:
Subject: Re: How to handle missing pgsql.connect_timeout