Thread: pgbench -T isn't a hard cutoff.

pgbench -T isn't a hard cutoff.

From
"mark"
Date:
Using the -T flag in pgbench I noticed that -T is a just a effort rather
than a hard cut off.

With a (misbehaving) pooler and a "large" number of clients+jobs it's
possible to have the pgbench run extend by several seconds or even minutes
past the allotted time by -T. (or hang indefinitely if the transactions
never complete due to pooler issues.)

Expected behavior would be -T would mean a hard cut off.


Thoughts ?

-Mark

Re: pgbench -T isn't a hard cutoff.

From
Tom Lane
Date:
"mark" <dvlhntr@gmail.com> writes:
> Expected behavior would be -T would mean a hard cut off.

Why would you expect that?

What I'd expect is that each transaction would be run to completion,
which would mean that -T cannot possibly be exact.  Even if it were,
what's your notion of "exact"?  Clock resolutions are different on
different platforms.

            regards, tom lane

Re: pgbench -T isn't a hard cutoff.

From
Greg Smith
Date:
On 08/26/2011 11:13 PM, mark wrote:
> Using the -T flag in pgbench I noticed that -T is a just a effort rather
> than a hard cut off.
> ...
> Expected behavior would be -T would mean a hard cut off.
>

If there's a hard cut-off, that means that partially completed
transactions are not included in the total.  That produces less correct
results than the current scheme.

With the current behavior, worrying about partial amounts being ignored
isn't a problem.  But there is the potential problem you report, which
is mainly a risk when pgbench is combined with a badly setup environment.

It's hard to justify making a change that will produce less accurate
results in the vast majority of cases, just to improve behavior in a
situation where useless results are coming out no matter what.

--
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us

Re: pgbench -T isn't a hard cutoff.

From
Itagaki Takahiro
Date:
On Mon, Aug 29, 2011 at 12:22, Greg Smith <greg@2ndquadrant.com> wrote:
> It's hard to justify making a change that will produce less accurate results
> in the vast majority of cases, just to improve behavior in a situation where
> useless results are coming out no matter what.

When I added -T option, I only expected standard pgbench transactions.
Since they are short enough, the difference should not be large.

If you have a plan to execute custom queries that take 1 second
or more, a hard cut-off makes senses.

--
Itagaki Takahiro