pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bill Moran <wmoran@collaborativefusion.com>
To: Campbell, Lance <lance@uiuc.edu>
Cc: Richard Huxton <dev@archonet.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Recommended Initial Settings
Date: Fri, 23 Feb 2007 13:11:37 -0500
Message-ID: <20070223131137.06824192.wmoran@collaborativefusion.com> (raw)
In-Reply-To: <A3AC4FA47DC0B1458C3E5396E685E63302395CE9@SAB-DC1.sab.uiuc.edu>
References: <A3AC4FA47DC0B1458C3E5396E685E63302395CE7@SAB-DC1.sab.uiuc.edu>
	<45DF1660.101@archonet.com>
	<A3AC4FA47DC0B1458C3E5396E685E63302395CE9@SAB-DC1.sab.uiuc.edu>

In response to "Campbell, Lance" <lance@uiuc.edu>:

> Richard,
> Thanks for your reply.  
> 
> You said:
> "Your operating-system should be doing the caching for you."
> 
> My understanding is that as long as Linux has memory available it will
> cache files.  Then from your comment I get the impression that since
> Linux would be caching the data files for the postgres database it would
> be redundant to have a large shared_buffers.  Did I understand you
> correctly?

Keep in mind that keeping the data in the kernel's buffer requires
Postgres to make a syscall to read a file, which the kernel then realizes
is cached in memory.  The kernel then has to make that data available
to the Postgres (userland) process.

If the data is in Postgres' buffers, Postgres can fetch it directly, thus
avoiding the overhead of the syscalls and the kernel activity.  You still
have to make sysvshm calls, though.

So, it depends on which is able to manage the memory better.  Is the
kernel so much more efficient that it makes up for the overhead of the
syscalls?  My understanding is that in recent versions of Postgres,
this is not the case, and large shared_buffers improve performance.
I've yet to do any in-depth testing on this, though.

-- 
Bill Moran
Collaborative Fusion Inc.



view thread (6+ messages)

Message-ID: <20070223131137.06824192.wmoran@collaborativefusion.com>
Permalink:  ../20070223131137.06824192.wmoran@collaborativefusion.com/
Also on:    postgresql.org/message-id/20070223131137.06824192.wmoran@collaborativefusion.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: wmoran@collaborativefusion.com, lance@uiuc.edu, dev@archonet.com
  Subject: Re: Recommended Initial Settings
  In-Reply-To: <20070223131137.06824192.wmoran@collaborativefusion.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