From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Huan Ruan <huan.ruan.it@gmail.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: shared_buffers vs Linux file cache
Date: Thu, 15 Jan 2015 18:24:05 -0500
Message-ID: <30353.1421364245@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMkU=1x0R1pkSOMS08pid=c0Ruu6ZwWo_JXU-2cTDL0ivai2+A@mail.gmail.com>
References: <CAD1stZv-iJUTRoMkj8xq_NdaNhrtHvjKO98wzEJAhf+TsgYdcA@mail.gmail.com>
<CAMkU=1x0R1pkSOMS08pid=c0Ruu6ZwWo_JXU-2cTDL0ivai2+A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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: tgl@sss.pgh.pa.us, jeff.janes@gmail.com, huan.ruan.it@gmail.com
Subject: Re: shared_buffers vs Linux file cache
In-Reply-To: <30353.1421364245@sss.pgh.pa.us>
* 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