X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id C5EBAD1C93E for ; Tue, 5 Aug 2003 20:05:44 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 34913-07 for ; Tue, 5 Aug 2003 17:04:26 -0300 (ADT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 58839D1C92D for ; Tue, 5 Aug 2003 17:05:33 -0300 (ADT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.9/8.12.9) with ESMTP id h75JxYMY023460; Tue, 5 Aug 2003 13:59:34 -0600 (MDT) Date: Tue, 5 Aug 2003 13:46:07 -0600 (MDT) From: "scott.marlowe" To: Lynna Landstreet Cc: Subject: Re: PHP Connections In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/11 X-Sequence-Number: 2188 On Tue, 5 Aug 2003, Lynna Landstreet wrote: > on 8/5/03 3:07 PM, scott.marlowe at scott.marlowe@ihs.com wrote: > > > On Tue, 5 Aug 2003, Lynna Landstreet wrote: > > > >> But hey, come to think of it, maybe I could turn the pg_connect into a > >> pg_pconnect and just have it check to see if $db already exists before > >> connecting - that way there'd be only one connection per site visit! Cool, > >> your question gave me a new idea... :-) > > > > Be VERY wary of persistant connections. They are fraught with danger and > > can cause your server to present the "too many connections" error message > > after being up for a while. > > Hmmm, OK. I didn't realize they didn't time out. Maybe it's best to leave it > the way it is now, with just one pg_connect being called in the head of each > document. Thanks. they can be set to, but it's by request, not over time. max requests per child or some such setting. Setting it low enough helps prevent certain problems. It's just that the default settings for apache/php/postgresql are all designed to make your box go kaboom if you use persistant connects. :-)