Re: [PATCH] add --throttle option to pgbench

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] add --throttle option to pgbench
Date: 2013-04-29 16:56:28
Message-ID: CAMkU=1xEW69gP3RYE37iXgh7q4imTBA5Yq0fdu1VV6hHQkzgrg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 29, 2013 at 8:27 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Fabien COELHO <coelho(at)cri(dot)ensmp(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-04-29 16:59:18 Re: ALTER DEFAULT PRIVILEGES FOR ROLE is broken
Previous Message Josh Berkus 2013-04-29 16:50:06 Re: ALTER DEFAULT PRIVILEGES FOR ROLE is broken