Re: Figuring out shared buffer pressure

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Figuring out shared buffer pressure
Date: 2012-05-30 18:23:49
Message-ID: 20120530182349.GC26894@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 30, 2012 at 11:06:45AM -0700, Jeff Janes wrote:
> On Wed, May 30, 2012 at 10:57 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > On Wed, May 30, 2012 at 10:38:10AM -0700, Jeff Janes wrote:
> >> On Wed, May 30, 2012 at 9:56 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> >> > As part of a blog, I started looking at how a user could measure the
> >> > pressure on shared buffers, e.g. how much are they being used, recycled,
> >> > etc.
> >> >
> >> > They way you normally do it on older operating systems is to see how
> >> > many buffers on the free list (about to be reused) are reclaimed as
> >> > needed --- that usually indicates kernel cache pressure.  Unfortunately,
> >> > we don't have a freelist, except for initial assignment of shared
> >> > buffers on startup.
> >>
> >> Isn't that what the buffers_alloc from pg_stat_bgwriter is ?
> >
> > The issue is that once a buffer is removed from the free list, it is
> > never returned to the free list.
>
> A buffer doesn't need to be removed from the linked list in order for
> buffers_alloc to get incremented.

Seems buffers_alloc is the number of calls to StrategyGetBuffer(), which
tells how many time we have requested a buffer. Not sure how that helps
measure buffer pressure.

> Conceptually, the freelist consists not only of the linked list, but
> also of all unpinned buffers with a usagecount of zero.

True. I guess my problem is can't find out how many of those
zero-uage-count buffers are being reclaimed as needed.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2012-05-30 18:31:22 Re: 9.2beta1, parallel queries, ReleasePredicateLocks, CheckForSerializableConflictIn in the oprofile
Previous Message Jeff Janes 2012-05-30 18:06:45 Re: Figuring out shared buffer pressure