| Lists: | pgsql-hackers |
|---|
| From: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
|---|---|
| To: | PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | PATCH: remove nclients/nthreads constraint from pgbench |
| Date: | 2015-04-27 11:21:03 |
| Message-ID: | alpine.DEB.2.10.1504270715420.13807@sto |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
Remove pgbench constraint that the number of clients must be a multiple of
the number of threads, by sharing clients among threads as evenly as
possible.
Rational: allows to test the database load with any number of client
without unrelated constraint. The current setting means for instance that
testing with a prime number of clients always uses one thread, whereas
other number of clients can use a different number of threads. This
constraint does not make much sense.
--
Fabien.
| Attachment | Content-Type | Size |
|---|---|---|
| pgbench-nclients-1.patch | text/x-diff | 2.8 KB |
| From: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
|---|---|
| To: | PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: PATCH: remove nclients/nthreads constraint from pgbench |
| Date: | 2015-05-08 12:02:23 |
| Message-ID: | alpine.DEB.2.10.1505081400320.20788@sto |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
Minor v2 update to change a not badly chosen variable name.
--
Fabien.
| Attachment | Content-Type | Size |
|---|---|---|
| pgbench-nclients-2.patch | text/x-diff | 2.8 KB |
| From: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
|---|---|
| To: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: PATCH: remove nclients/nthreads constraint from pgbench |
| Date: | 2015-07-02 11:36:58 |
| Message-ID: | 5595225A.60000@iki.fi |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
On 05/08/2015 03:02 PM, Fabien COELHO wrote:
>
> Remove pgbench constraint that the number of clients must be a multiple of
> the number of threads, by sharing clients among threads as evenly as
> possible.
>
> Rational: allows to test the database load with any number of client
> without unrelated constraint. The current setting means for instance that
> testing with a prime number of clients always uses one thread, whereas
> other number of clients can use a different number of threads. This
> constraint does not make much sense.
> ..
> Minor v2 update to change a not badly chosen variable name.
+1, it's really annoying that you can't just do -j<high number> and
always run with that.
This doesn't behave correctly if you set -j to greater than -c, and also
use the rate limit option:
---- This works ----
$ ./pgbench -R 100 -j3 -c 3 -T 10 postgres
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 5
query mode: simple
number of clients: 3
number of threads: 3
duration: 10 s
number of transactions actually processed: 1031
latency average: 1.397 ms
latency stddev: 0.276 ms
rate limit schedule lag: avg 0.119 (max 1.949) ms
tps = 102.947257 (including connections establishing)
tps = 102.967251 (excluding connections establishing)
---- This does not; too small TPS ----
$ ./pgbench -R 100 -j100 -c 3 -T 10 postgres
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 5
query mode: simple
number of clients: 3
number of threads: 100
duration: 10 s
number of transactions actually processed: 40
latency average: 3.573 ms
latency stddev: 1.724 ms
rate limit schedule lag: avg 0.813 (max 4.722) ms
tps = 3.246618 (including connections establishing)
tps = 3.246639 (excluding connections establishing)
I think that can be fixed by just setting nthreads internally to
nclients, if nthreads > nclients. But please double-check that the logic
used to calculate throttle_delay makes sense in general, when nthreads
is not a multiple of nclients.
- Heikki
| From: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
|---|---|
| To: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
| Cc: | PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: PATCH: remove nclients/nthreads constraint from pgbench |
| Date: | 2015-07-02 12:58:31 |
| Message-ID: | alpine.DEB.2.10.1507021456050.5962@sto |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
> This doesn't behave correctly if you set -j to greater than -c, and also use
> the rate limit option:
> [...]
>
> I think that can be fixed by just setting nthreads internally to nclients, if
> nthreads > nclients. But please double-check that the logic used to calculate
> throttle_delay makes sense in general, when nthreads is not a multiple of
> nclients.
Indeed, I probably did not consider nthreads > nclients. The fix you
suggest seems ok. I'll check it before sending a new v3.
--
Fabien.
| From: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
|---|---|
| To: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
| Cc: | PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: PATCH: remove nclients/nthreads constraint from pgbench |
| Date: | 2015-07-03 04:50:19 |
| Message-ID: | alpine.DEB.2.10.1507030648300.9460@sto |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
> This doesn't behave correctly if you set -j to greater than -c, and also use
> the rate limit option:
Indeed. v3 attached fixed the case when nthreads > nclients.
--
Fabien.
| Attachment | Content-Type | Size |
|---|---|---|
| pgbench-nclients-3.patch | text/x-diff | 3.0 KB |
| From: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
|---|---|
| To: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
| Cc: | PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: PATCH: remove nclients/nthreads constraint from pgbench |
| Date: | 2015-07-03 07:52:30 |
| Message-ID: | 55963F3E.30305@iki.fi |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
On 07/03/2015 07:50 AM, Fabien COELHO wrote:
>> This doesn't behave correctly if you set -j to greater than -c, and also use
>> the rate limit option:
>
> Indeed. v3 attached fixed the case when nthreads > nclients.
Ok, committed. Thanks!
- Heikki
| From: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> |
|---|---|
| To: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
| Cc: | PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: PATCH: remove nclients/nthreads constraint from pgbench |
| Date: | 2015-07-03 08:00:34 |
| Message-ID: | alpine.DEB.2.10.1507031000160.16176@sto |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Lists: | pgsql-hackers |
>> Indeed. v3 attached fixed the case when nthreads > nclients.
>
> Ok, committed. Thanks!
Thanks!
--
Fabien.