Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3ED33633043 for ; Fri, 9 Jul 2010 04:52:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 76511-05 for ; Fri, 9 Jul 2010 07:52:32 +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 9EF956324D6 for ; Fri, 9 Jul 2010 04:52:32 -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 11EB184F8E; Fri, 9 Jul 2010 15:52:06 +0800 (WST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 7526FAED57; Fri, 9 Jul 2010 15:50:46 +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 pdetVnvqXadm; Fri, 9 Jul 2010 15:50:41 +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 E9BC2AED56; Fri, 9 Jul 2010 15:50:40 +0800 (WST) Message-ID: <4C36D537.1090709@postnewspapers.com.au> Date: Fri, 09 Jul 2010 15:52:23 +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: Tom Lane CC: Samuel Gendler , pgsql-performance@postgresql.org Subject: Re: Need help in performance tuning. References: <4C369346.6010501@postnewspapers.com.au> <8760.1278650566@sss.pgh.pa.us> In-Reply-To: <8760.1278650566@sss.pgh.pa.us> 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=-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/144 X-Sequence-Number: 39533 On 09/07/10 12:42, Tom Lane wrote: > Samuel Gendler writes: >> On Thu, Jul 8, 2010 at 8:11 PM, Craig Ringer >> wrote: >>> If you're not using a connection pool, start using one. > >> I see this issue and subsequent advice cross this list awfully >> frequently. Is there in architectural reason why postgres itself >> cannot pool incoming connections in order to eliminate the requirement >> for an external pool? > > Perhaps not, but there's no obvious benefit either. Since there's > More Than One Way To Do It, it seems more practical to keep that as a > separate problem that can be solved by a choice of add-on packages. Admittedly I'm relatively ignorant of the details, but I increasingly think PostgreSQL will need a different big architectural change in the coming years, as the typical performance characteristics of machines change: It'll need to separate "running queries" from "running processes", or start threading backends, so that one way or the other a single query can benefit from the capabilities of multiple CPUs. The same separation, or a move to async I/O, might be needed to get one query to concurrently read multiple partitions of a table, or otherwise get maximum benefit from high-capacity I/O subsystems when running just a few big, expensive queries. Otherwise I'm wondering if PostgreSQL will begin really suffering in performance on workloads where queries are big and expensive but there are relatively few of them running at a time. My point? *if* I'm not full of hot air and there's some truth to my blather above, any change like that might be accompanied by a move to separate query execution state from connection state, so that idle connections have a much lower resource cost. OK, that's my hand-waving for the day done. -- Craig Ringer