Skip site navigation (1) Skip section navigation (2)

Sorting writes during checkpoint

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-patches(at)postgresql(dot)org
Subject: Sorting writes during checkpoint
Date: 2008-04-15 09:19:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Here is a patch for TODO item, "Consider sorting writes during checkpoint".
It writes dirty buffers in the order of block number during checkpoint
so that buffers are written sequentially.

I proposed the patch before, but it was rejected because 8.3 feature
has been frozen already at that time.

I rewrote it to be applied cleanly against current HEAD, but the concept
is not changed at all -- Memorizing pairs of (buf_id, BufferTag) for each
dirty buffer into an palloc-ed array at the start of checkpoint. Sorting
the array in BufferTag order and writing buffers in the order.

There are 10% of performance win in pgbench on my machine with RAID-0
disks. There can be more benefits on RAID-5 disks, because random writes
are slower than sequential writes there.

  tps = 1134.233955 (excluding connections establishing)
[HEAD with patch]
  tps = 1267.446249 (excluding connections establishing)

transaction type: TPC-B (sort of)
scaling factor: 100
query mode: simple
number of clients: 32
number of transactions per client: 100000
number of transactions actually processed: 3200000/3200000

2x Quad core Xeon, 16GB RAM, 4x HDD (RAID-0)

shared_buffers = 2GB
wal_buffers = 4MB
checkpoint_segments = 64
checkpoint_timeout = 5min
checkpoint_completion_target = 0.5

ITAGAKI Takahiro
NTT Open Source Software Center

Attachment: sorted-ckpt-84.patch
Description: application/octet-stream (2.9 KB)

In response to


pgsql-hackers by date

Next:From: Zdenek KotalaDate: 2008-04-15 10:46:35
Subject: WIP: Pg_upgrade - page layout converter (PLC) hook
Previous:From: Martijn van OosterhoutDate: 2008-04-15 08:25:36
Subject: Re: [HACKERS] printTable API (was: Show INHERIT in \du)

pgsql-patches by date

Next:From: Greg SmithDate: 2008-04-15 13:16:40
Subject: Re: Sorting writes during checkpoint
Previous:From: Martijn van OosterhoutDate: 2008-04-15 08:25:36
Subject: Re: [HACKERS] printTable API (was: Show INHERIT in \du)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group