Re: Log levels for checkpoint/bgwriter monitoring

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Greg Smith <gsmith(at)gregsmith(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Log levels for checkpoint/bgwriter monitoring
Date: 2007-03-09 07:08:59
Message-ID: 20070309155356.636E.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Greg Smith <gsmith(at)gregsmith(dot)com> wrote:

> > In my understanding, each backend pins two or so buffers at once. So
> > percentage of pinned buffers should be low.
>
> With the pgbench workload, a substantial percentage of the buffer cache
> ends up pinned.

> http://westnet.com/~gsmith/content/postgresql/new-patch-checkpoint.txt
> bgwriter scan all writes=16.6 MB (69.3%) pinned=11.7 MB (48.8%) LRU=7.7 MB (31.9%)
> ...
> checkpoint required (wrote checkpoint_segments)
> checkpoint buffers dirty=19.4 MB (80.8%) write=188.9 ms sync=4918.1 ms
>
> Here 69% of the buffer cache contained dirty data, and 49% of the cache
> was both pinned and dirty.

No. "Pinned" means bufHdr->refcount > 0 and you don't distinguish pinned or
recently-used (bufHdr->usage_count > 0) buffers in your patch.

! if (bufHdr->refcount != 0 || bufHdr->usage_count != 0)
{
! if (skip_pinned)
! {
! UnlockBufHdr(bufHdr);
! return BUF_PINNED;
! }
! buffer_write_type=BUF_WRITTEN_AND_PINNED;

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message August Zajonc 2007-03-09 07:44:46 Re: Acclerating INSERT/UPDATE using UPS
Previous Message Christian Bird 2007-03-09 06:54:32 Re: who gets paid for this