From: Jean-Luc Lachance <jllachan@nsd.ca>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: jim@nasby.net, "scott.marlowe" <scott.marlowe@ihs.com>
Cc: Matthew Nuzum <cobalt@bearfruit.org>
Cc: 'Josh Berkus' <josh@agliodbs.com>
Cc: 'Pgsql-Performance' <pgsql-performance@postgresql.org>
Subject: Re: Caching (was Re: choosing the right platform)
Date: Thu, 10 Apr 2003 10:27:16 -0400
Message-ID: <3E957F44.A1106F6A@nsd.ca> (raw)
References: <00a001c2febb$631141d0$6900a8c0@mattspc>
<Pine.LNX.4.33.0304091152550.22442-100000@css120.ihs.com>
<20030409184744.W31861@flake.decibel.org>
<11732.1049934037@sss.pgh.pa.us>
Tom,
What appends when PG scans a table that is is too big to fit in the
cache?
Won't the whole cache get trashed and swapped off to disk?
Shouldn't there be a way to lock some tables in PG cache?
Who about caracterizing some of the RAM like: scan, index, small
frequently used tables.
JLL
Tom Lane wrote:
> [...]
> PG is *not* any smarter about the usage patterns of its disk buffers
> than the kernel is; it uses a simple LRU algorithm that is surely no
> brighter than what the kernel uses. (We have looked at smarter buffer
> recycling rules, but failed to see any performance improvement.) So the
> notion that PG can do a better job of cache management than the kernel
> is really illusory. About the only advantage you gain from having data
> directly in PG buffers rather than kernel buffers is saving the CPU
> effort needed to move data across the userspace boundary --- which is
> not zero, but it's sure a lot less than the time spent for actual I/O.
>
> So my take on it is that you want shared_buffers fairly small, and let
> the kernel do the bulk of the heavy lifting for disk cache. That's what
> it does for a living, so let it do what it does best. You only want
> shared_buffers big enough so you don't spend too many CPU cycles shoving
> data back and forth between PG buffers and kernel disk cache. The
> default shared_buffers setting of 64 is surely too small :-(, but my
> feeling is that values in the low thousands are enough to get past the
> knee of that curve in most cases.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: jllachan@nsd.ca, tgl@sss.pgh.pa.us, scott.marlowe@ihs.com, cobalt@bearfruit.org, josh@agliodbs.com
Subject: Re: Caching (was Re: choosing the right platform)
In-Reply-To: <3E957F44.A1106F6A@nsd.ca>
References: <00a001c2febb$631141d0$6900a8c0@mattspc> <Pine.LNX.4.33.0304091152550.22442-100000@css120.ihs.com> <20030409184744.W31861@flake.decibel.org> <11732.1049934037@sss.pgh.pa.us> <3E957F44.A1106F6A@nsd.ca>
* 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