Re: shared_buffers vs Linux file cache - Mailing list pgsql-performance

From Tom Lane
Subject Re: shared_buffers vs Linux file cache
Date
Msg-id 30353.1421364245@sss.pgh.pa.us
Whole thread Raw
In response to Re: shared_buffers vs Linux file cache  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: shared_buffers vs Linux file cache
List pgsql-performance
Jeff Janes <jeff.janes@gmail.com> writes:
> On Thu, Jan 15, 2015 at 3:30 AM, Huan Ruan <huan.ruan.it@gmail.com> wrote:
>> I thought 'shared_buffers' sets how much memory that is dedicated to
>> PostgreSQL to use for caching data, therefore not available to other
>> applications.

> While PostgreSQL has reserves the right to use 32GB, as long as PostgreSQL
> has not actually dirtied that RAM yet, then the kernel is free to keep
> using it to cache files.

Another thing to keep in mind is that, even if Postgres *has* used the
RAM, the kernel might decide to swap parts of it out if it's not being
used heavily.  This is pretty disastrous from a performance standpoint,
so it's advisable to not make shared_buffers very much larger than what
your application will keep "hot".

Ideally we'd lock the shared buffer arena into RAM to prevent that,
but such facilities are often unavailable or restricted to root.

            regards, tom lane


pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Strange choice of general index over partial index
Next
From: Jeff Janes
Date:
Subject: Re: Strange choice of general index over partial index