Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E31E0632769 for ; Mon, 12 Jul 2010 07:59:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 28334-04 for ; Mon, 12 Jul 2010 10:58:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.4.227.11]) by mail.postgresql.org (Postfix) with ESMTP id 4E41C6324A7 for ; Mon, 12 Jul 2010 07:58:54 -0300 (ADT) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id 83EE279246; Mon, 12 Jul 2010 18:58:50 +0800 (WST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 4243FAF6EC; Mon, 12 Jul 2010 18:56:51 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id LMfhzHbMBFiB; Mon, 12 Jul 2010 18:56:45 +0800 (WST) Received: from [10.1.1.6] (124-168-255-56.dyn.iinet.net.au [124.168.255.56]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 6D371AF636; Mon, 12 Jul 2010 18:56:45 +0800 (WST) Message-ID: <4C3AF564.5030204@postnewspapers.com.au> Date: Mon, 12 Jul 2010 18:58:44 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: Matthew Wakeling CC: pgsql-performance@postgresql.org Subject: Re: Pooling in Core WAS: Need help in performance tuning. References: <4C369346.6010501@postnewspapers.com.au> <8760.1278650566@sss.pgh.pa.us> <1278680186.1914.36.camel@bnicholson-desktop> <4C36F57102000025000332F6@gw.wicourts.gov> <4C36FEAD02000025000332FC@gw.wicourts.gov> <4C37A9C1.1060405@2ndquadrant.com> <4C37791C0200002500033379@gw.wicourts.gov> <4C37CBFB.1000800@agliodbs.com> <4C37EA1D.6000008@postnewspapers.com.au> <4C38BF03.6060503@agliodbs.com> <19244.1278787866@sss.pgh.pa.us> In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/183 X-Sequence-Number: 39572 On 12/07/10 17:45, Matthew Wakeling wrote: > > I'm surprised. Doesn't apache httpd do this? Does it have to do a whole > load of non-portable stuff? It seems to work on a whole load of platforms. A lot of what Apache HTTPd does is handled via the Apache Portable Runtime (APR). It contains a lot of per-platform handlers for various functionality. http://apr.apache.org/docs/apr/1.4/modules.html I don't know if the socket passing is provided as part of APR or is part of Apache HTTPd its self, but I wouldn't be at all surprised if it was in APR. Personally I'm now swayed by arguments presented here that trying to push pooling into core isn't really desirable, and that better packaging/bundling of existing solutions would be better. Perhaps documenting the pluses/minuses of the current pooling options and providing clear recommendations on which to use for different use cases would help, since half the trouble is users not knowing they need a pool or being confused as to which to select. This discussion reminds me a bit of Hibernate's built-in client-side connection pool. It has one, but it's a unloved stepchild that even the Hibernate devs suggest should be avoided in favour of a couple of external 3rd party options. A built-in pool seems like a great idea, but there are multiple existing ones because they solve different problems in different ways. Unless a built-in one could solve ALL those needs, or be so vastly simpler (due to code re-use, easier configuration, etc) that it's worth building one that won't fit everyone's needs, then it's best to stick to the existing external options. So rather than asking "should core have a connection pool" perhaps what's needed is to ask "what can an in-core pool do that an external pool cannot do?" Admission control / resource limit features would be great to have in core, and can't really be done fully in external modules ... but could be designed in ways that would allow external poolers to add functionality on top. Josh Berkus has made some good points on why this isn't as easy as it looks, though: http://it.toolbox.com/blogs/database-soup/admission-control-and-its-discontents-39895 -- Craig Ringer