Re: The shared buffers challenge

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Scott Carey <scott(at)richrelevance(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Merlin Moncure <mmoncure(at)gmail(dot)com>, postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: The shared buffers challenge
Date: 2011-05-27 18:26:31
Message-ID: 4DDFECD7.7090208@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Scott Carey wrote:
> And there is an OS component to it too. You can actually get away with
> shared_buffers at 90% of RAM on Solaris. Linux will explode if you try
> that (unless recent kernels have fixed its shared memory accounting).
>

You can use much larger values for shared_buffers on Solaris with UFS as
the filesystem than almost anywhere else, as you say. UFS defaults to
caching an extremely tiny amount of memory by default. Getting
PostgreSQL to buffer everything therefore leads to minimal
double-caching and little write caching that creates checkpoint spikes,
so 90% is not impossible there.

If you're using ZFS instead, that defaults to similar aggressive caching
as Linux. You may even have to turn that down if you want the database
to have a large amount of memory for its own use even with normal levels
of sizing; just space for shared_buffers and work_mem can end up being
too large of a pair of competitors for caching RAM. ZFS is not really
not tuned all that differently from how Linux approaches caching in that
regard.

--
Greg Smith 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2011-05-27 18:47:51 Re: The shared buffers challenge
Previous Message Kevin Grittner 2011-05-27 17:07:09 Re: The shared buffers challenge