Re: pgbench -i spends all its time doing CHECKPOINT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgbench -i spends all its time doing CHECKPOINT
Date: 2002-01-06 18:37:34
Message-ID: 26310.1010342254@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> question is if we do a big transaction that needs 10 log segments, do we
> force an early CHECKPOINT to clear out the WAL segments or do we just
> wait for the proper interval?

A checkpoint is forced after every CHECKPOINT_SEGMENTS log segments,
regardless of longevity of transactions. See
http://developer.postgresql.org/docs/postgres/wal-configuration.html

Since segments before the checkpoint-before-last are deleted or recycled
after each checkpoint, the maximum number of back segments would
normally be 2 * CHECKPOINT_SEGMENTS. We also pre-create WAL_FILES
future log segments. Counting the current segment gives a total of
WAL_FILES + 2 * CHECKPOINT_SEGMENTS + 1 log segments.

AFAICS, the only way to force the current code into creating more than
WAL_FILES + 2 * CHECKPOINT_SEGMENTS + 1 log segments is to be generating
WAL entries at such a high rate that more than WAL_FILES log segments
are filled before a triggered checkpoint can be completed.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message mlw 2002-01-06 18:38:05 Spinning verses sleeping in s_lock
Previous Message Bruce Momjian 2002-01-06 18:01:41 Re: pgbench -i spends all its time doing CHECKPOINT