Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 85B816340DD for ; Thu, 22 Jul 2010 18:30:18 -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 97491-03 for ; Thu, 22 Jul 2010 21:30:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.anarazel.de (mail.anarazel.de [217.115.131.40]) by mail.postgresql.org (Postfix) with ESMTP id D5187633373 for ; Thu, 22 Jul 2010 18:30:09 -0300 (ADT) Received: by mail.anarazel.de (Postfix, from userid 108) id F206E448004; Thu, 22 Jul 2010 23:30:06 +0200 (CEST) Received: from anarazel.de (e178217027.adsl.alicedsl.de [85.178.217.27]) by mail.anarazel.de (Postfix) with ESMTPSA id 466F6448004; Thu, 22 Jul 2010 23:30:02 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id B02D11C00A0; Thu, 22 Jul 2010 23:29:54 +0200 (CEST) Date: Thu, 22 Jul 2010 23:29:54 +0200 From: Andres Freund To: Robert Haas Cc: Craig Ringer , Matthew Wakeling , pgsql-performance@postgresql.org Subject: Re: Pooling in Core WAS: Need help in performance tuning. Message-ID: <20100722212954.GA16758@anarazel.de> References: <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> <4C3AF564.5030204@postnewspapers.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.51 tagged_above=-10 required=5 tests=BAYES_05=-0.5, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/327 X-Sequence-Number: 39716 On Thu, Jul 22, 2010 at 02:33:43PM -0400, Robert Haas wrote: > On Mon, Jul 12, 2010 at 6:58 AM, Craig Ringer > wrote: > > 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. > > Apache just has all of the worker processes call accept() on the > socket, and whichever one the OS hands it off to gets the job. As an inconsequential detail - afaik they keep the os from doing that by protecting it with a mutex for various reasons (speed - as some implementations wake up and see theres nothing to do, multiple sockets, fairness) > The problem is harder for us because a backend can't switch identities > once it's been assigned to a database. I haven't heard an adequate > explanation of why that couldn't be changed, though. Possibly it might decrease the performance significantly enough by reducing the cache locality (syscache, prepared plans)? Andres