Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 16AC71246F17 for ; Tue, 15 Nov 2011 04:12:39 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 45799-01 for ; Tue, 15 Nov 2011 08:12:33 +0000 (UTC) X-Greylist: delayed 00:07:18.604317 by SQLgrey-1.8.0-rc2 Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 0A9C41246F15 for ; Tue, 15 Nov 2011 04:12:33 -0400 (AST) Received: from mailout-de.gmx.net ([213.165.64.23]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1RQE0z-0007y2-8r for pgsql-performance@postgresql.org; Tue, 15 Nov 2011 08:05:13 +0000 Received: (qmail invoked by alias); 15 Nov 2011 08:04:55 -0000 Received: from office.icomedias.com (EHLO [10.192.1.141]) [109.73.147.5] by mail.gmx.net (mp053) with SMTP; 15 Nov 2011 09:04:55 +0100 X-Authenticated: #5984785 X-Provags-ID: V01U2FsdGVkX1+2xy4Lcmi2n5ymFpu5oLtjtwnpOHF8txwzx24vA4 OBU29WLaEBc9Zd Message-ID: <4EC21D24.3060804@gmx.at> Date: Tue, 15 Nov 2011 09:04:52 +0100 From: Mario Weilguni User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Large number of short lived connections - could a connection pool help? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.799 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.1, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201111/180 X-Sequence-Number: 45691 Am 15.11.2011 01:42, schrieb Cody Caughlan: > We have anywhere from 60-80 background worker processes connecting to > Postgres, performing a short task and then disconnecting. The lifetime > of these tasks averages 1-3 seconds. > > I know that there is some connection overhead to Postgres, but I dont > know what would be the best way to measure this overheard and/or to > determine if its currently an issue at all. > > If there is a substantial overheard I would think that employing a > connection pool like pgbouncer to keep a static list of these > connections and then dole them out to the transient workers on demand. > > So the overall cumulative number of connections wouldnt change, I > would just attempt to alleviate the setup/teardown of them so quickly. > > Is this something that I should look into or is it not much of an > issue? Whats the best way to determine if I could benefit from using a > connection pool? > > Thanks. > I had a case where a pooler (in this case pgpool) resulted in a 140% application improvement - so - yes, it is probably a win to use a pooling solution.