Re: [PATCH] add --throttle option to pgbench - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: [PATCH] add --throttle option to pgbench
Date
Msg-id CAMkU=1xEW69gP3RYE37iXgh7q4imTBA5Yq0fdu1VV6hHQkzgrg@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] add --throttle option to pgbench  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] add --throttle option to pgbench
Re: [PATCH] add --throttle option to pgbench [patch 2]
List pgsql-hackers
On Mon, Apr 29, 2013 at 8:27 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Fabien COELHO <coelho@cri.ensmp.fr> writes:
> 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'm having a hard time understanding the use-case for this feature.
Surely, if pgbench is throttling its transaction rate, you're going
to just end up measuring the throttle rate.


While I don't understand the part about his laptop battery, I think that there is a good use case for this.  If you are looking at latency distributions or spikes, you probably want to see what they are like with a load which is like the one you expect having, not the load which is the highest possible.   Although for this use case you would almost surely be using custom transaction files, not default ones, so I think you could just use \sleep.  However, I don't know if there is an easy way to dynamically adjust the sleep value by subtracting off the overhead time and randomizing it a bit, like is done here.    

It does seem to me that we should Poissonize the throttle time, then subtract the average overhead, rather than Poissonizing the difference.

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: ALTER DEFAULT PRIVILEGES FOR ROLE is broken
Next
From: Tom Lane
Date:
Subject: Re: ALTER DEFAULT PRIVILEGES FOR ROLE is broken