Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 5E3B81337BD2 for ; Sun, 1 May 2011 11:11:13 -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 04277-09 for ; Sun, 1 May 2011 14:11:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qmta12.westchester.pa.mail.comcast.net (qmta12.westchester.pa.mail.comcast.net [76.96.59.227]) by mail.postgresql.org (Postfix) with ESMTP id 889DD1337BB4 for ; Sun, 1 May 2011 11:11:05 -0300 (ADT) Received: from omta14.westchester.pa.mail.comcast.net ([76.96.62.60]) by qmta12.westchester.pa.mail.comcast.net with comcast id eE951g0011HzFnQ5CEB6cN; Sun, 01 May 2011 14:11:06 +0000 Received: from sz0093.wc.mail.comcast.net ([76.96.58.151]) by omta14.westchester.pa.mail.comcast.net with comcast id eEB61g00J3FmDic3aEB66b; Sun, 01 May 2011 14:11:06 +0000 Date: Sun, 1 May 2011 14:11:06 +0000 (UTC) From: Lou Picciano To: Javier Reyes Cc: pgsql-admin@postgresql.org Message-ID: <1388090922.738519.1304259066269.JavaMail.root@sz0093a.westchester.pa.mail.comcast.net> In-Reply-To: <881491270.738428.1304258927478.JavaMail.root@sz0093a.westchester.pa.mail.comcast.net> Subject: Re: Option shared_buffers in PostgreSQL MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_738518_336253797.1304259066269" X-Originating-IP: [76.117.178.80] X-Mailer: Zimbra 6.0.5_GA_2431.RHEL5_64 (ZimbraWebClient - SAF3 (Mac)/6.0.5_GA_2427.RHEL4) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.907 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/2 X-Sequence-Number: 37439 ------=_Part_738518_336253797.1304259066269 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Javier, There has been much discussion of this. Generally - and though it's a bit counter-intuitive - wholesale increase in PostgreSQL's shared buffer won't give you the outcomes you might expect. In short, once there's enough, there's enough. Workmem is another option which behaves along these lines. Reason for this is that PostgreSQL makes _very_ good use of its surrounding memory environment; IE, after a certain point, it's better to focus on tweaking your OS and operating environment. Now, there will probably be some 'optimal' shared memory and workmem settings, given the specifics of your query and execution environment; here's where mileage will vary. But you shouldn't expect a direct and/or linear increase in performance with doubling/quadrupling of shared memory. You'll get answers here from folks well above my paygrade, but I think that's a fair rough outline. (!!) Lou Picciano ----- Original Message ----- From: "Javier Reyes" To: pgsql-admin@postgresql.org Sent: Sunday, May 1, 2011 7:20:15 AM Subject: [ADMIN] Option shared_buffers in PostgreSQL Hello. I have a server with 4GB of RAM and PostgreSQL 9.0.3 on Centos 5. I'm using pgbench and pgbench-tools to measure performance, using two pgbench-tools queries: select and tpc-b. With default settings of postgresql.conf and select query, I get the following results: Scale: 1, 10, 100, 1000. Transactions per second: 10000, 8800, 7500, 100. (the number of records of the table is scale*100000) I've only increased the option shared_buffer to 256MB (previously had 32 MB) and I get the following results: Scale: 1, 10, 100, 1000. Transactions per second: 10000, 8000, 3200, 30 I don't understand why when the scale is 100 or more in the second benchmark, the performance is so low compared to the first test. The only thing I have done was increase the memory. I've thrown every test twice and the results were similar. In an earlier test, the memory configuration was: shared_buffers = 512 MB maintenance_work_mem = 8MB effective_cache_size = 1GB work_mem = 2MB And the results were similar, even slightly worse. For that reason, I did tests changing options one by one, to know what was the cause of poor performance. And "the winner" is shared_buffers... Thanks. ------=_Part_738518_336253797.1304259066269 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <= div style=3D'font-family: Verdana; font-size: 12pt; color: #000000'>Javier,=

There has been much discussion of this. 

Generally - and though it's a bit counter-intuitive - whole= sale increase in PostgreSQL's shared buffer won't give you the outcomes you= might expect. In short, once there's enough, there's enough. Workmem is an= other option which behaves along these lines. Reason for this is that Postg= reSQL makes _very_ good use of its surrounding memory environment; IE, afte= r a certain point, it's better to focus on tweaking your OS and operating e= nvironment.

Now, there will probably be some 'opti= mal' shared memory and workmem settings, given the specifics of your query = and execution environment; here's where mileage will vary. But you shouldn'= t expect a direct and/or linear increase in performance with doubling/quadr= upling of shared memory.

You'll get answers h= ere from folks well above my paygrade, but I think that's a fair rough outl= ine. (!!)

Lou Picciano

----- Original Message -----
From: "Javier Reyes" <c.javier.reyes.e= @gmail.com>
To: pgsql-admin@postgresql.org
Sent: Sunday, May 1, 20= 11 7:20:15 AM
Subject: [ADMIN] Option shared_buffers in PostgreSQL
Hello.

I have a server with 4GB of RAM and PostgreSQL 9.0.3 on Cen= tos 5. I'm using pgbench and pgbench-tools to measure performance, using tw= o pgbench-tools queries: select and tpc-b.

With default settings of = postgresql.conf and select query, I get the following results:

Scale: 1, 10, 100, 1000.
Transactions per second: 10000, 8800, 7500,= 100.

(the number of records of the table is scale*100000)

I'= ve only increased the option shared_buffer to 256MB (previously had 32 MB) = and I get the following results:

Scale: 1, 10, 100, 1000.
Transactions per second: 10000, 8000, 3200,= 30

I don't understand why when the scale is 100 or more in the seco= nd benchmark, the performance is so low compared to the first test. The onl= y thing I have done was increase the memory.

I've thrown every test twice and the results were similar. In an earlie= r test, the memory configuration was:

shared_buffers =3D 512 MB maintenance_work_mem =3D 8MB
effective_cache_size =3D 1GB
work_mem = =3D 2MB

And the results were similar, even slightly worse. For that reason, I d= id tests changing options one by one, to know what was the cause of poor pe= rformance. And "the winner" is shared_buffers...

Thanks.
------=_Part_738518_336253797.1304259066269--