Re: Starting PostgreSQL 8.0.4 with more memory [FreeBSD

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Vlad <marchenko(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Starting PostgreSQL 8.0.4 with more memory [FreeBSD
Date: 2005-10-31 22:10:15
Message-ID: 1130796614.15018.29.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2005-10-31 at 15:44, Simon Riggs wrote:
> On Mon, 2005-10-31 at 14:50 -0600, Scott Marlowe wrote:
>
> > As I understand it, when the last backend referencing a collection of
> > data stops referencing it, that the buffers holding that data are
> > released, and if, a second later, another backend wants the data, then
> > it has to go to the Kernel for it again.
>
> Unreferenced data is not immediately released to the kernel. When a
> backend requests a datablock that is not in shared_buffers it will
> select an unreferenced buffer, write it if required (hopefully not
> required because of the bgwriter), then overwrite the shared_buffer
> cache with the datablock it is trying to read from "disk". All reads and
> writes go through the OS cache, which does pretty much the same thing
> but with a different algorithm. So "disk" might just mean OS cache.

Hence the reason I carefully hedged my reference as "getting it from the
kernel." I wasn't really wanting to discuss how the kernel manages to
make it magically appear, as it's the kernel's job to do it and keep
track of it.

The point behind my post was that the kernel caches AND buffers, while
postgresql technically only really seems to buffer, with a little
incidental caching thrown in if you catch it at the right time.

I was mainly wondering if that behaviour had changed, if, when the data
are released, they are still held in shared memory until forced out by
newer / more popular data. Which would make the buffer pool a real
cache.

As long as postgresql releases hold on all those buffers when they're
not needed, I would think it was a buffer, not a real cache, and it
shouldn't normally be tuned as a cache.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-10-31 22:12:04 Re: Starting PostgreSQL 8.0.4 with more memory [FreeBSD
Previous Message Martijn van Oosterhout 2005-10-31 21:47:50 Re: Starting PostgreSQL 8.0.4 with more memory [FreeBSD