pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together.
3+ messages / 2 participants
[nested] [flat]

* Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together.
@ 2017-01-25 14:06 nuko yokohama <nuko.yokohama@gmail.com>
  2017-01-25 14:25 ` Re: Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together. Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 1 reply; 3+ messages in thread

From: nuko yokohama @ 2017-01-25 14:06 UTC (permalink / raw)
  To: pgsql-bugs

Hi.

I attempted to make the following measurements using PostgreSQL 9.6.0
pgbench on CentOS 7.

$ pgbench -P 5 -R 400 -C -S -r -c 4 -T 30 bench -U postgres

However, this benchmark did not work properly.

* I refer to pg_stat_activity, but no connection from pgbench to PostgreSQL.
* pgbench does not stop even after the time specified by the -T option
elapses.

It operates normally when only the -C option or only the -R option is
specified.

In the PostgreSQL document, It is not described that "these two options can
not be specified at the same time ".
Is this a problem of pgbench?

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together.
  2017-01-25 14:06 Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together. nuko yokohama <nuko.yokohama@gmail.com>
@ 2017-01-25 14:25 ` Fabien COELHO <coelho@cri.ensmp.fr>
  2017-01-25 17:59   ` Re: Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together. Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 1 reply; 3+ messages in thread

From: Fabien COELHO @ 2017-01-25 14:25 UTC (permalink / raw)
  To: nuko yokohama <nuko.yokohama@gmail.com>; +Cc: pgsql-bugs


> It operates normally when only the -C option or only the -R option is 
> specified.
>
> In the PostgreSQL document, It is not described that "these two options 
> can not be specified at the same time ". Is this a problem of pgbench?

Yes, indeed there is. Thanks for the report. Option -C is seldom used and 
tested.

-- 
Fabien.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together.
  2017-01-25 14:06 Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together. nuko yokohama <nuko.yokohama@gmail.com>
  2017-01-25 14:25 ` Re: Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together. Fabien COELHO <coelho@cri.ensmp.fr>
@ 2017-01-25 17:59   ` Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 0 replies; 3+ messages in thread

From: Fabien COELHO @ 2017-01-25 17:59 UTC (permalink / raw)
  To: nuko yokohama <nuko.yokohama@gmail.com>; +Cc: pgsql-bugs


>> It operates normally when only the -C option or only the -R option is 
>> specified.
>> 
>> In the PostgreSQL document, It is not described that "these two options can 
>> not be specified at the same time ". Is this a problem of pgbench?
>
> Yes, indeed there is. Thanks for the report. Option -C is seldom used and 
> tested.

The problem is already fixed in head. Looking at git log, it was unclear 
to guess which change fixed that... After another reading, I got it in 
one, it has been fixed by Heikki restructuring patch 
12788ae49e1933f463bc59a6efe46c4a01701b76 which has no vocation to be 
backpatched to prior versions...

The bug is that prior to --rate doCustom was always disconnect/reconnect 
without exiting, but with rate it returns if it has to wait. However 
threadRun test whether there is a connection before recalling doCustom, so 
it was never called.

This is exactly the kind of unmanageable state combination that 
refactoring has cleaned up.

Attached a small patch which fixes the issue, I think, in 9.6.
Fixing it raised another issue wrt to some stats under -C, that I fixed as 
well.

-- 
Fabien.

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

pgbench-CR-bug-1.patch (text/x-diff, 731B) download diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 531671a..1f1b7bf 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -1967,7 +1967,6 @@ top: st->listen = false; st->sleeping = false; st->throttling = false; - st->is_throttled = false; memset(st->prepared, 0, sizeof(st->prepared)); } @@ -4345,6 +4344,12 @@ threadRun(void *arg) remains--; /* I've aborted */ } } + else if (is_connect && st->sleeping) + { + /* it is sleeping for throttling, maybe it is done, let us try */ + if (!doCustom(thread, st, &aggs)) + remains--; + } if (st->ecnt > prev_ecnt && commands[st->state]->type == META_COMMAND) {
^ permalink raw reply [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-01-25 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25 14:06 Problem in using pgbench's --connect(-C) and --rate=rate(-R rate) options together. nuko yokohama <nuko.yokohama@gmail.com>
2017-01-25 14:25 ` Fabien COELHO <coelho@cri.ensmp.fr>
2017-01-25 17:59   ` Fabien COELHO <coelho@cri.ensmp.fr>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox