X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EEB388B9B86 for ; Wed, 2 Feb 2005 08:49:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77948-08 for ; Wed, 2 Feb 2005 08:49:10 +0000 (GMT) Received: from pw6tiger.de (pw6tiger.de [217.160.140.116]) by svr1.postgresql.org (Postfix) with SMTP id 63C038B9B69 for ; Wed, 2 Feb 2005 08:49:10 +0000 (GMT) Received: (qmail 10910 invoked by uid 505); 2 Feb 2005 08:49:08 -0000 Received: from vygen@planwerk6.de by planwerk6 by uid 89 with qmail-scanner-1.14 (virus scan: Clear:. Processed in 0.193854 secs); 02 Feb 2005 08:49:08 -0000 Received: from isi-dsl-120-164.isionline-dialin.de (HELO jv.pw6.de) (vygen@planwerk6.de@213.128.120.164) by pw6tiger.de with SMTP; 2 Feb 2005 08:49:08 -0000 From: Janning Vygen Organization: PLANWERK 6 To: Christopher Murtagh Subject: Re: How to handle missing pgsql.connect_timeout Date: Wed, 2 Feb 2005 09:49:20 +0100 User-Agent: KMail/1.7.1 Cc: pgsql-php@postgresql.org References: <200502010938.17853.vygen@gmx.de> <200502011740.48639.vygen@planwerk6.de> <1107277832.12116.1.camel@localhost.localdomain> In-Reply-To: <1107277832.12116.1.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502020949.21251.vygen@planwerk6.de> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/7 X-Sequence-Number: 2981 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