X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2E3D352B88 for ; Fri, 15 Jul 2005 11:16:22 -0300 (ADT) 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 55579-04 for ; Fri, 15 Jul 2005 14:16:18 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6170752B13 for ; Fri, 15 Jul 2005 11:16:14 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j6FEGH3x011127; Fri, 15 Jul 2005 10:16:17 -0400 (EDT) To: "Jeffrey W. Baker" Cc: karim.nassar@acm.org, pgsql-performance@postgresql.org Subject: Re: What's a lot of connections? In-reply-to: <1121411682.7733.0.camel@noodles> References: <1121410859.4715.87.camel@localhost.localdomain> <1121411682.7733.0.camel@noodles> Comments: In-reply-to "Jeffrey W. Baker" message dated "Fri, 15 Jul 2005 00:14:42 -0700" Date: Fri, 15 Jul 2005 10:16:16 -0400 Message-ID: <11126.1121436976@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/215 X-Sequence-Number: 13456 "Jeffrey W. Baker" writes: > On Fri, 2005-07-15 at 00:00 -0700, Karim Nassar wrote: >> I am working on a system that uses postgresql 7.4.2 (can't change that >> until 8.1 goes stable). Just figured out that there are about 285,000 >> connections created over about 11 hours every day. That averages out to >> about 7.2 connections per second. >> >> Is that a lot? I've never seen that many. > I see about 8 million connections per full day. Connecting to postgres > is cheap. It's not *that* cheap. I think you'd get materially better performance if you managed to pool your connections a bit. By the time a backend has started, initialized itself, joined a database, and populated its internal caches with enough catalog entries to get useful work done, you've got a fair number of cycles invested in it. Dropping the backend after only one or two queries is just not going to be efficient. regards, tom lane