Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id AD66A2E0068 for ; Fri, 15 Feb 2008 15:34:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 47880-01 for ; Fri, 15 Feb 2008 15:34:36 -0400 (AST) Received: from brmea-mail-4.sun.com (brmea-mail-4.Sun.COM [192.18.98.36]) by postgresql.org (Postfix) with ESMTP id E09842E002C for ; Fri, 15 Feb 2008 15:34:35 -0400 (AST) Received: from fe-amer-10.sun.com ([192.18.109.80]) by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m1FJYYGE023046 for ; Fri, 15 Feb 2008 19:34:34 GMT Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0JWA00901OZ82R00@mail-amer.sun.com> (original mail from J.K.Shah@Sun.COM) for pgsql-performance@postgresql.org; Fri, 15 Feb 2008 12:34:34 -0700 (MST) Received: from jignesh-shahs-computer.local ([129.150.35.81]) by mail-amer.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0JWA0076UP16OE10@mail-amer.sun.com>; Fri, 15 Feb 2008 12:34:19 -0700 (MST) Date: Fri, 15 Feb 2008 14:34:33 -0500 From: "Jignesh K. Shah" Subject: Re: shared_buffers in 8.3 w/ lots of RAM on dedicated PG machine In-reply-to: To: Greg Smith Cc: Peter Schuller , pgsql-performance@postgresql.org Message-id: <47B5E949.7070103@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <20080215123528.GA16532@hyperion.scode.org> <20080215133734.GU12156@it.is.rice.edu> <20080215135846.GA17327@hyperion.scode.org> User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/185 X-Sequence-Number: 28727 Greg Smith wrote: > On Fri, 15 Feb 2008, Peter Schuller wrote: > >> Or is it a matter of PostgreSQL doing non-direct I/O, such that >> anything cached in shared_buffers will also be cached by the OS? > > PostgreSQL only uses direct I/O for writing to the WAL; everything > else goes through the regular OS buffer cache unless you force it to > do otherwise at the OS level (like some Solaris setups do with > forcedirectio). This is one reason it still make not make sense to > give an extremely high percentage of RAM to PostgreSQL even with > improvements in managing it. Another is that shared_buffers memory > has to be reconciled with disk at every checkpoint, where OS buffers > do not. A third is that your OS may just be more efficient at > buffering--it knows more about the underlying hardware, and the > clock-sweep method used internally by PostgreSQL to simulate a LRU > cache is not extremely sophisticated. > > However, don't feel limited by the general 25% rule; it's certainly > worth exploring whether 50% or more works better for your workload. > You'll have to benchmark that yourself though, and I'd suggest using > pg_buffercache: > http://www.postgresql.org/docs/8.3/static/pgbuffercache.html to get an > idea just what the pages are being used for. > As per the test that I have done mostly with forcedirectio on Solaris, I have seen gains with increasing the buffercache to about somewhere between 10GB and thats when thing seem to take a turn... So in my case I am generally comfortable for Postgres to use about 8-10GB beyond which I am cautious. Also with tests with UFS buffered for table/index and forcedirectio it seems to perform better with forcedirectio .. However if you do want to exploit the extra RAM with UFS then you have to do some tunings for UFS in Solaris.. Now with machines with 32GB becoming common this is something worth pursuing depending on the storage if it can handle the directio load or not. Regards, Jignesh