X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 55F84D1E158 for ; Fri, 27 Feb 2004 21:16:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 24043-08 for ; Fri, 27 Feb 2004 17:16:45 -0400 (AST) Received: from emo.org.tr (emo.org.tr [195.142.105.9]) by svr1.postgresql.org (Postfix) with ESMTP id 980B0D1E103 for ; Fri, 27 Feb 2004 17:16:42 -0400 (AST) Received: by emo.org.tr (Postfix, from userid 41643) id A8464EE35A; Fri, 27 Feb 2004 23:16:38 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by emo.org.tr (Postfix) with ESMTP id A12BAEE358; Fri, 27 Feb 2004 23:16:38 +0200 (EET) Date: Fri, 27 Feb 2004 23:16:36 +0200 (EET) From: Devrim GUNDUZ X-X-Sender: devrim2@emo.org.tr To: Andy Dunlop Cc: pgsql-php@postgresql.org Subject: Re: Too many clients In-Reply-To: <1077877268.1247.9.camel@redhat1.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/45 X-Sequence-Number: 2593 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, On 27 Feb 2004, Andy Dunlop wrote: > I occasionally get the error "too many clients" when connecting to the > database. I try restarting the Postgres server and also Apache, but the > only thing that clears the problem is restarting Linux. I have maxusers > set to 35, and I am the only user, so I suspect I am not doing something > in my scripts that I should be, or doing something that I shouldn't be! > I have the pg_connect at the top of the script so each time it loads the > page it does a new connect - maybe this is a problem? The max_connections parameter of PostgreSQL is the max number of connections 'at the same time'. So, if your web site has more than 33 visitors (let's say 2 connections were "superuser_reserved_connections") at the same time, then you'll get the error "too many connections". BTW, PHP calls pg_close() at the end of script execution, if you are using pg_connect ('not pg_pconnect') at the beginning of the script. To get rid of that error, * Make sure that you aren't using pg_pconnect * Increase max_connections parameter, as well as the parameters related to it. Regards, - -- Devrim GUNDUZ devrim@gunduz.org devrim.gunduz@linux.org.tr http://www.TDMSoft.com http://www.gunduz.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFAP7O2tl86P3SPfQ4RAvnbAKCTRWe1MT/L3ps6TVCIvTduyGozTACffmde Yp3RnOxG90Q7LawzzhTLyC8= =+cPt -----END PGP SIGNATURE-----