Lockless pg_buffercache

From: "Markus Bertheau" <mbertheau(dot)pg(at)googlemail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Lockless pg_buffercache
Date: 2008-02-10 04:34:40
Message-ID: 684362e10802092034rebc1e67n910f5ddb8816a31d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I want to use the pg_buffercache contrib module for monitoring our
server. It takes a lock on all buffers and then on each buffer header
in order to get a consistent picture of the buffers. I would be
running the function provided by the module once every 5 minutes.

I'm worrying about the performance hit of that - a comment in the code
says it's horrible for concurrency. Additionally, as I don't use this
for debugging, but just for monitoring, I don't need a 100% consistent
picture, just rough numbers how much of the buffer cache is used for
what relation.

Does removing all locking as in the attached patch have any negative
impact other than the non-consistency of the results?

Thanks

Markus

Attachment Content-Type Size
pg_buffercache_nolocks.patch text/x-diff 1.8 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gurjeet Singh 2008-02-10 05:33:52 Re: pg_restore seems slow
Previous Message Dean Gibson (DB Administrator) 2008-02-10 04:15:36 Re: Where is the system-wide psqlrc on RHEL4?