Add pgbench option: CHECKPOINT before starting benchmark

From: KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Add pgbench option: CHECKPOINT before starting benchmark
Date: 2013-08-30 07:54:22
Message-ID: 52204FAE.4090301@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I add checkpoint option to pgbench.

pgbench is simple and useful benchmark for every user. However, result of
benchmark greatly changes by some situations which are in executing checkpoint,
number of dirty buffers in share_buffers, and so on. For such a problem, it is
custom to carry out a checkpoint before starting benchmark. But it is a fact that
the making of the script takes time, like under following script.

psql -U postgres -d pgbench -p5432 -c "CHECKPOINT"
pgbench -T 600 -c 12 -j4 -U postgres -d pgbench -p 5432

However, this script have a problem.
This script execute "CHECKPOINT" -> "VACUUM" -> "starting benchmark".
If relpages have lot of dirty pages, VACUUM generate dirty buffers on
shared_buffers, and it will cause bad heavily checkpoint.

I think pgbench would be more easy and accuracy benchmark tools for everyone. So
I set checkpoint before starting benchmark.

This patch's output is here.
-----------------------------------------------------
[mitsu-ko(at)localhost pgbench]$ ./pgbench
starting vacuum...end.
starting checkpoint...end.
transaction type: TPC-B (sort of)
scaling factor: 1
query mode: simple
number of clients: 1
number of threads: 1
number of transactions per client: 10
number of transactions actually processed: 10/10
tps = 312.851958 (including connections establishing)
tps = 364.524478 (excluding connections establishing)
-----------------------------------------------------
It execute "VACUUM" -> "CHECKPOINT" -> "starting benchmark".
I think it is ideal setting for more accuracy benchmark.

My patches option difinition is here.
[mitsu-ko(at)localhost pgbench]$ ./pgbench --help
~
-N, --no-checkpoint do not run CHECKPOINT after initialization
~
In latest commited pgbench, -N is "--skip-some-updates skip updates of
pgbench_tellers and pgbench_branches". But I cannot understand why -N is this
option, so I set this option -u, and -N is "do not run CHECKPOINT option".

What do you think?
--
Mitsumasa KONDO
NTT Open Source Software Center

Attachment Content-Type Size
checkpoint_before_starting_benchmark_v0.patch text/x-diff 3.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2013-08-30 08:02:59 Re: Add pgbench option: CHECKPOINT before starting benchmark
Previous Message Heikki Linnakangas 2013-08-30 06:57:10 Re: Compression of full-page-writes