Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BE43A1337B88 for ; Mon, 4 Oct 2010 00:07:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 59442-01-6 for ; Mon, 4 Oct 2010 03:07:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by mail.postgresql.org (Postfix) with ESMTP id E7B281337BCE for ; Mon, 4 Oct 2010 00:07:31 -0300 (ADT) Received: from [192.168.1.6] (static-71-179-240-8.bltmmd.fios.verizon.net [71.179.240.8]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LzFY5-1OgRtp3u4n-0153ZH; Mon, 04 Oct 2010 05:07:29 +0200 Message-ID: <4CA944EF.5040702@2ndquadrant.com> Date: Sun, 03 Oct 2010 23:07:27 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Samuel Gendler CC: =?ISO-8859-1?Q?Fabr=EDcio_dos_Anjos_Silva?= , pgsql-performance@postgresql.org Subject: Re: How does PG know if data is in memory? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:MOz14GHBQBTS0R1v8Kxrx5U4I6ONZHVz2olP7+Oh71H zScnVbwhrkv0CWmQVvyTRLcEuBbWr43EAjXfDfDT7W991JVSGg kx2ehqWhOX/q7R8cdvCAwHjTvtwq4MKnddeNE+G758aTmQsBMT jjKKbsnQodyS0WC5r9DcdKMB5AxTXIuSpZEInV1WwItOwAq+Ji VedGVbuZ12ZlA8ZzSNuRzL3X2FvjHWGI7V8iAP6LUc= 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, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/19 X-Sequence-Number: 40438 Samuel Gendler wrote: > As to your question about increasing shared_buffers to be some > significant proportion of available RAM - apparently, that is not a > good idea. I've seen advice that said you shouldn't go above 8GB for > shared_buffers and I've also seen 12GB suggested as an upper limit, > too. On my host with 48GB of RAM, I didn't see much difference > between 8GB and 12GB on a fairly wide variety of tests, so mine is set > at 8GB with an efective_cache_size of 36GB. The publicly discussed tests done at Sun suggested 10GB was the effective upper limit on Solaris before performance started dropping instead of increasing on some of their internal benchmarks. And I've heard privately from two people who have done similar experiments on Linux and found closer to 8GB to be the point where performance started to drop. I'm hoping to get some hardware capable of providing some more public results in this area, and some improvements if we can get better data about what causes this drop in efficiency. Given that some write-heavy workloads start to suffer considerable checkpoint issues when shared_buffers is set to a really high value, there's at least two reasons to be conservative here. The big win is going from the tiny default to hundreds of megabytes. Performance keeps going up for many people into the low gigabytes range, but the odds of hitting a downside increase too. Since PostgreSQL uses the OS cache, too, I see some sytems with a whole lot of RAM where the 512MB - 1GB range still ends up being optimal, just in terms of balancing the improvements you get from things being in the cache vs. the downsides of heavy checkpoint writes. -- Greg Smith, 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services and Support www.2ndQuadrant.us Author, "PostgreSQL 9.0 High Performance" Pre-ordering at: https://www.packtpub.com/postgresql-9-0-high-performance/book