Re: Add pgbench option: CHECKPOINT before starting benchmark

From: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
To: KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add pgbench option: CHECKPOINT before starting benchmark
Date: 2013-08-30 08:02:59
Message-ID: 522051B3.8020401@catalyst.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 30/08/13 19:54, KONDO Mitsumasa wrote:
> 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?
>

+1

I have been using a script to add CHECKPOINT before pgbench runs for
ages...adding the option to pgbench is a great idea (wish I had thought
of it)!

Regards

Mark

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Cédric Villemain 2013-08-30 08:20:48 Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Previous Message KONDO Mitsumasa 2013-08-30 07:54:22 Add pgbench option: CHECKPOINT before starting benchmark