[PATCH] add --throttle option to pgbench

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] add --throttle option to pgbench
Date: 2013-04-29 12:42:40
Message-ID: alpine.DEB.2.02.1304291411110.24306@localhost6.localdomain6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello,

Please find attached a small patch to add a throttling capability to
pgbench, that is pgbench aims at a given client transaction rate instead
of maximizing the load. The throttling relies on Poisson-distributed
delays inserted after each transaction.

I wanted that to test the impact of various load levels, and for
functionnal tests on my laptop which should not drain the battery.

sh> ./pgbench -T 10 -c 2 --throttle 10tps test
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
query mode: simple
number of clients: 2
number of threads: 1
duration: 10 s
number of transactions actually processed: 214
tps = 21.054216 (including connections establishing)
tps = 21.071253 (excluding connections establishing)

--
Fabien.

Attachment Content-Type Size
pgbench-throttle.patch text/x-diff 7.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2013-04-29 13:56:40 Re: Graph datatype addition
Previous Message Robert Haas 2013-04-29 11:05:32 Re: ALTER DEFAULT PRIVILEGES FOR ROLE is broken