Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3B660B5DBD8 for ; Fri, 10 Jun 2011 10:02:19 -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 59390-01 for ; Fri, 10 Jun 2011 13:02:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [173.230.139.50]) by mail.postgresql.org (Postfix) with ESMTP id BC6FFB5DBCA for ; Fri, 10 Jun 2011 10:02:11 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by www.postnewspapers.com.au (Postfix) with ESMTP id C334A123; Fri, 10 Jun 2011 09:02:11 -0400 (EDT) X-Virus-Scanned: amavisd-new at postnewspapers.com.au.com Received: from www.postnewspapers.com.au ([127.0.0.1]) by localhost (www.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nws7UZEdqEJL; Fri, 10 Jun 2011 09:02:11 -0400 (EDT) Received: from mail.postnewspapers.com.au (ppp171-128.static.internode.on.net [150.101.171.128]) by www.postnewspapers.com.au (Postfix) with ESMTP id 5A85F2D; Fri, 10 Jun 2011 09:02:10 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 35E6CAF4C3; Fri, 10 Jun 2011 21:02:06 +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 7xxWS7qgDCDh; Fri, 10 Jun 2011 21:01:59 +0800 (WST) Received: from [10.1.1.5] (124-169-230-7.dyn.iinet.net.au [124.169.230.7]) (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 5EA48AF4AD; Fri, 10 Jun 2011 21:01:55 +0800 (WST) Message-ID: <4DF215B7.7040005@postnewspapers.com.au> Date: Fri, 10 Jun 2011 21:01:43 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10 MIME-Version: 1.0 To: Anibal David Acosta CC: pgsql-performance@postgresql.org Subject: Re: how much postgres can scale up? References: <000601cc2761$a2e3a280$e8aae780$@devshock.com> In-Reply-To: <000601cc2761$a2e3a280$e8aae780$@devshock.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: 201106/118 X-Sequence-Number: 44051 On 06/10/2011 07:29 PM, Anibal David Acosta wrote: > I know that with this information you can figure out somethigns, but in > normal conditions, Is normal the degradation of performance per connection > when connections are incremented? With most loads, you will find that the throughput per-worker decreases as you add workers. The overall throughput will usually increase with number of workers until you reach a certain "sweet spot" then decrease as you add more workers after that. Where that sweet spot is depends on how much your queries rely on CPU vs disk vs memory, your Pg version, how many disks you have, how fast they are and in what configuration they are in, what/how many CPUs you have, how much RAM you have, how fast your RAM is, etc. There's no simple formula because it's so workload dependent. The usual *very* rough rule of thumb given here is that your sweet spot should be *vaguely* number of cpu cores + number of hard drives. That's *incredibly* rough; if you care you should benchmark it using your real workload. If you need lots and lots of clients then it may be beneficial to use a connection pool like pgbouncer or PgPool-II so you don't have lots more connections trying to do work at once than your hardware can cope with. Having fewer connections doing work in the database at the same time can improve overall performance. -- Craig Ringer