pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: VJK <vjkmail@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Fwd: shared_buffers advice
Date: Wed, 17 Mar 2010 11:08:03 -0400
Message-ID: <600ad6df1003170808ne9304eeha745ca5a7946a467@mail.gmail.com> (raw)
In-Reply-To: <600ad6df1003170543m7f056ax63ce9a2ffdcd6f8@mail.gmail.com>
References: <a056b1d41003101728h2bfe964cg43bf5ef1aabae14d@mail.gmail.com>
	<600ad6df1003170543m7f056ax63ce9a2ffdcd6f8@mail.gmail.com>

See below:


On Wed, Mar 10, 2010 at 9:28 PM, Paul McGarry <paul@paulmcgarry.com> wrote:

> Hi there,
>
> I'm after a little bit of advice on the shared_buffers setting (I have
> read the various docs on/linked from the performance tuning wiki page,
> some very helpful stuff there so thanks to those people).
>
> I am setting up a 64bit Linux server running Postgresql 8.3, the
> server has 64gigs of memory and Postgres is the only major application
> running on it. (This server is to go alongside some existing 8.3
> servers, we will look at 8.4/9 migration later)
>
> I'm basically wondering how the postgresql cache (ie shared_buffers)
> and the OS page_cache interact. The general advice seems to be to
> assign 1/4 of RAM to shared buffers.
>
> I don't have a good knowledge of the internals but I'm wondering if
> this will effectively mean that roughly the same amount of RAM being
> used for the OS page cache will be used for redundantly caching
> something the Postgres is caching as well?
>
> IE when Postgres reads something from disk it will go into both the OS
> page cache and the Postgresql shared_buffers and the OS page cache
> copy is unlikely to be useful for anything.
>
> If that is the case what are the downsides to having less overlap
> between the caches, IE heavily favouring one or the other, such as
> allocating shared_buffers to a much larger percentage (such as 90-95%
> of expected 'free' memory).
>
> Pg apparently does not have an option of using direct IO with reads which
some other databases do (the O_DIRECT mode).  Therefore,  double-buffering
with read operations seems unavoidable.  Counterintuitively,   it may be a
good idea to just rely on OS buffering and keep shared_buffers rather small,
say, 512MB.

VJ




> Paul
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>

view thread (51+ messages)  latest in thread

Message-ID: <600ad6df1003170808ne9304eeha745ca5a7946a467@mail.gmail.com>
Permalink:  ../600ad6df1003170808ne9304eeha745ca5a7946a467@mail.gmail.com/
Also on:    postgresql.org/message-id/600ad6df1003170808ne9304eeha745ca5a7946a467@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: vjkmail@gmail.com
  Subject: Re: Fwd: shared_buffers advice
  In-Reply-To: <600ad6df1003170808ne9304eeha745ca5a7946a467@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox