Re: shared_buffers vs Linux file cache

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Huan Ruan <huan(dot)ruan(dot)it(at)gmail(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: shared_buffers vs Linux file cache
Date: 2015-01-15 22:22:17
Message-ID: CAMkU=1x0R1pkSOMS08pid=c0Ruu6ZwWo_JXU-2cTDL0ivai2+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Jan 15, 2015 at 3:30 AM, Huan Ruan <huan(dot)ruan(dot)it(at)gmail(dot)com> wrote:

> Hi All
>
> I thought 'shared_buffers' sets how much memory that is dedicated to
> PostgreSQL to use for caching data, therefore not available to other
> applications.
>
> However, as shown in the following screenshots, The server (CentOS 6.6
> 64bit) has 64GB of RAM, and 'shared_buffer' is set to 32GB, but the
> free+buffer+cache is 60GB.
>
> Shouldn't the maximum value for free+buffer+cache be 32GB ( 64 - 32)?
> Is 'shared_buffers' pre allocated to Postgres, and Postgres only?
>

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.

Cheers,

Jeff

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2015-01-15 22:30:08 Strange choice of general index over partial index
Previous Message Glyn Astill 2015-01-15 17:10:31 Re: shared_buffers vs Linux file cache