X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 48731D1DA34 for ; Wed, 14 Jan 2004 13:36:57 +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 10171-02 for ; Wed, 14 Jan 2004 09:36:25 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 811CCD1BBB0 for ; Wed, 14 Jan 2004 09:36:22 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i0EDaGU8089732 for ; Wed, 14 Jan 2004 13:36:22 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i0EDShOM079944 for pgsql-performance@postgresql.org; Wed, 14 Jan 2004 13:28:43 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: 100 simultaneous connections, critical limit? Date: Wed, 14 Jan 2004 08:27:03 -0500 Organization: cbbrowne Computing Inc Lines: 25 Message-ID: References: <40053A91.5060001@physicallink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Reasonable Discussion, linux) Cancel-Lock: sha1:ezlTQxgPWSEPryB19vKMiMeTv4c= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/139 X-Sequence-Number: 5314 Clinging to sanity, jonr@physicallink.com (Jón Ragnarsson) mumbled into her beard: > I am writing a website that will probably have some traffic. > Right now I wrap every .php page in pg_connect() and pg_close(). > Then I read somewhere that Postgres only supports 100 simultaneous > connections (default). Is that a limitation? Should I use some other > method when writing code for high-traffic website? I thought the out-of-the-box default was 32. If you honestly need a LOT of connections, you can configure the database to support more. I "upped the limit" on one system to have 512 the other week; certainly supportable, if you have the RAM for it. It is, however, quite likely that the connect()/close() cuts down on the efficiency of your application. If PHP supports some form of "connection pooling," you should consider using that, as it will cut down _dramatically_ on the amount of work done establishing/closing connections, and should let your apps use somewhat fewer connections more effectively. -- (format nil "~S@~S" "cbbrowne" "acm.org") http://cbbrowne.com/info/linux.html "It has been said that man is a rational animal. All my life I have been searching for evidence which could support this." -- Bertrand Russell