pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Gauthier, Dave <dave.gauthier@intel.com>
Cc: Siddharth Shah <siddharth.shah@elitecore.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Shared Buffers
Date: Tue, 3 Mar 2009 23:51:01 -0700
Message-ID: <dcc563d10903032251y54a74c3cmaeb1f23f1d78d30b@mail.gmail.com> (raw)
In-Reply-To: <482E80323A35A54498B8B70FF2B8798003ED1B9CF0@azsmsx504.amr.corp.intel.com>
References: <49ABDB1F.2020208@elitecore.com>
	<482E80323A35A54498B8B70FF2B8798003ED1B9CF0@azsmsx504.amr.corp.intel.com>

On Mon, Mar 2, 2009 at 7:40 AM, Gauthier, Dave <dave.gauthier@intel.com> wrote:
> I believe that op system side buffering can play a role too.  I our case,
> the DB server (machine & op sys) caches data that it pulled from disk (not
> necessarily from a DB) and also the disk servers do the same.  If a block
> was removed from the DB buffer cache to accommodate more recently requested
> data, but the evicted block is live in memory on the DB server or the disk
> server, it can pull from there instead of performing an expensive disk-IO.

This is very true for certain workloads.  If your db is bigger than
memory, and you only work on a tiny bit at a time, the kernel is often
better at caching than pgsql.  Run something like pgbench on a machine
with say 4 Gig of memory and a 40 Gig pgbench db dir, and you're
better off with 128M or something for shared_buffers than 1G often
times.  Truly random small access, has, for me, worked better with
moderate to smaller shared_buffers.  Plus if you need to run a few
memory hog queries, the kernel can flush out some free memory from
cache quickly, but shared_buffers is static.  So, the kernel file
cache is self tuning.

But you'll have to test it with your application to really see.



view thread (17+ messages)  latest in thread

Message-ID: <dcc563d10903032251y54a74c3cmaeb1f23f1d78d30b@mail.gmail.com>
Permalink:  ../dcc563d10903032251y54a74c3cmaeb1f23f1d78d30b@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d10903032251y54a74c3cmaeb1f23f1d78d30b@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-general@postgresql.org
  Cc: scott.marlowe@gmail.com, dave.gauthier@intel.com, siddharth.shah@elitecore.com
  Subject: Re: Shared Buffers
  In-Reply-To: <dcc563d10903032251y54a74c3cmaeb1f23f1d78d30b@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