Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B8B4063250D for ; Wed, 28 Jul 2010 08:04:07 -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 36083-07 for ; Wed, 28 Jul 2010 11:04:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f46.google.com (mail-bw0-f46.google.com [209.85.214.46]) by mail.postgresql.org (Postfix) with ESMTP id DDC1D63230F for ; Wed, 28 Jul 2010 08:03:59 -0300 (ADT) Received: by bwz1 with SMTP id 1so3864263bwz.19 for ; Wed, 28 Jul 2010 04:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=iH7r9vwBrZTzH21vM8+1V5qY3t6XSAfSCoDCJtKPIRA=; b=UfmFQ1zrL4K0Xn2huWCKttLLwslCtSn/OmfI5w2c0yrP5pV1/6WEbTmSe37rIO1ZcX EkcyEc7qBrCHZWgX9H8K6W8gtkUNkZ/lFJdnKMwnY1/URRAQANQwPWD73bkFe/55k5gq 7ha3ui+qb1H8KEK86ipx23q3fzhQ2qrYG3a6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=YqEehX3UwCKxgwYbQmz3fE3wh/RFhMRxIGQUXa/oe+B9QUGfxEuRzSWrWvkynrC1c4 gcdlbJ2JOVOD4K4qt/n/RthzErob5d6VbuC3Mo4fMUiIm8v4kMO3oP7yKeDWTWB8zAMQ qRbhY15Tcs+cxAkTv9WaFjbmdZpaoaCd2GPLs= Received: by 10.204.178.68 with SMTP id bl4mr7739481bkb.119.1280315037854; Wed, 28 Jul 2010 04:03:57 -0700 (PDT) Received: from [10.1.1.57] (skuns.zoral.com.ua [91.193.166.194]) by mx.google.com with ESMTPS id bq20sm4686319bkb.4.2010.07.28.04.03.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 28 Jul 2010 04:03:56 -0700 (PDT) Message-ID: <4C500E9F.5090304@gmail.com> Date: Wed, 28 Jul 2010 14:03:59 +0300 From: Vitalii Tymchyshyn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100528 Thunderbird/3.0.5 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Pooling in Core WAS: Need help in performance tuning. 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> <20100722212954.GA16758@anarazel.de> <13654.1280263202@sss.pgh.pa.us> <20776.1280282217@sss.pgh.pa.us> In-Reply-To: <20776.1280282217@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201007/430 X-Sequence-Number: 39819 28.07.10 04:56, Tom Lane написав(ла): > > I'm not asserting it's true, just suggesting it's entirely possible. > Other than the fork() cost itself and whatever authentication activity > there might be, practically all the startup cost of a new backend can be > seen as cache-populating activities. You'd have to redo all of that, > *plus* pay the costs of getting rid of the previous cache entries. > Maybe the latter costs less than a fork(), or maybe not. fork() is > pretty cheap on modern Unixen. > > Actually as for me, the problem is that one can't raise number of database connections high without overloading CPU/memory/disk, so external pooling is needed. If postgresql had something like max_active_queries setting that limit number of connections that are not in IDLE [in transaction] state, one could raise max connections high (and I don't think idle process itself has much overhead) and limit max_active_queries to get maximum performance and won't use external pooling. Of course this won't help if the numbers are really high, but could work out the most common cases. Best regards, Vitalii Tymchyshyn