review: pgbench progress report improvements

Lists: pgsql-hackers
From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: coelho(at)cri(dot)ensmp(dot)fr
Subject: review: pgbench progress report improvements
Date: 2013-09-11 13:39:03
Message-ID: CAFj8pRAVYUhv8x3fEEwaSGGvDcijOgVLZSAVd7rmWn9Mw8RANA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello

* patched with minor warning
* compilable cleanly
* zero impact on PostgreSQL server functionality
* it does what was in proposal
** change 5sec progress as default (instead no progress)
** finalise a rate limit support - fixes a latency calculation
* code is clean
* documentation is included
* there is no voices against this patch and this patch increases a pgbench
usability/

I have only one question. When I tested this patch with throttling I got a
very similar values of lag.

[pavel(at)localhost ~]$ /usr/local/pgsql/bin/pgbench -T100 -j4 -c32 postgres
-R 60
starting vacuum...end.
progress: 5.0 s, 61.3 tps, 15.796 +- 11.287 ms lat, 0.118 ms lag
progress: 10.0 s, 60.8 tps, 16.527 +- 12.965 ms lat, 0.120 ms lag

[pavel(at)localhost ~]$ /usr/local/pgsql/bin/pgbench -T100 -j4 -c32 postgres
-R 80
starting vacuum...end.
progress: 5.0 s, 78.8 tps, 17.009 +- 11.666 ms lat, 0.163 ms lag
progress: 10.1 s, 74.3 tps, 33.510 +- 55.456 ms lat, 0.092 ms lag

[pavel(at)localhost ~]$ /usr/local/pgsql/bin/pgbench -T100 -j4 -c32 postgres
-R 40
starting vacuum...end.
progress: 5.2 s, 39.4 tps, 13.580 +- 10.283 ms lat, 0.182 ms lag
progress: 10.1 s, 49.3 tps, 13.192 +- 6.772 ms lat, 0.135 ms lag

What is sense, or what is semantic of this value? It is not detailed
documented. Should be printed this value in this form on every row? We can
print some warning when lag is higher than latency instead? Or we can use
this value, but it should be better documented, please.

Regards

Pavel Stehule

some minor issue:

patch warning

make[1]: Leaving directory `/home/pavel/src/postgresql/config'
[pavel(at)localhost postgresql]$ patch -p1 < pgbench-measurements-v2.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file contrib/pgbench/pgbench.c
(Stripping trailing CRs from patch; use --binary to disable.)
patching file doc/src/sgml/pgbench.sgml


From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: pgbench progress report improvements
Date: 2013-09-12 14:35:41
Message-ID: alpine.DEB.2.02.1309121604540.3884@localhost6.localdomain6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Hello Pavel,

Thanks for your review.

> * patched with minor warning
> * compilable cleanly
> * zero impact on PostgreSQL server functionality
> * it does what was in proposal
> ** change 5sec progress as default (instead no progress)
> ** finalise a rate limit support - fixes a latency calculation

Just a point about the motivation: the rationale for having a continuous
progress report is that benchmarking is subject to possibly long warmup
times, and thus a test may have to run for hours so as to be significant.
I find running a command for hours without any hint about what is going on
quite annoying.

> * code is clean
> * documentation is included
> * there is no voices against this patch and this patch increases a pgbench
> usability/
>
> I have only one question. When I tested this patch with throttling I got a
> very similar values of lag.

Yep. That is just good!

> What is sense, or what is semantic of this value?

The "lag" measures the stochastic processus health. Actually, it measures
how far behind schedule the clients are when performing throttled
transactions. If it was to increase, that would mean that something is
amiss, possibly not enough client threads or other issues. If it is small,
then all is well.

> It is not detailed documented.

It is documented in the section about the --rate option, see
http://www.postgresql.org/docs/devel/static/pgbench.html

> Should be printed this value in this form on every row? We can
> print some warning when lag is higher than latency instead?

Hmmm... what is important is when the lag changes values.

Generally one would indeed expect that to be smaller than the latency, but
that is not really possible when transaction are very fast, say under "-S"
with read-only queries that hit the memory cache.

Also the problem with printing warnings is that it changes the output
format, but it seems to me more useful to print the value, so that it can
be processed automatically and simply.

Also, from a remote client perspective, say a web application, the overall
latency is the lag plus the transaction latency: you first wait to get
through the database (lag), and then you can perform your transaction
(latency).

> Or we can use this value, but it should be better documented, please.

Is the documentation pointed above enough?

--
Fabien.


From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: pgbench progress report improvements
Date: 2013-09-12 15:34:32
Message-ID: alpine.DEB.2.02.1309121729210.3884@localhost6.localdomain6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


> * patched with minor warning

> some minor issue:
>
> patch warning
>
> make[1]: Leaving directory `/home/pavel/src/postgresql/config'
> [pavel(at)localhost postgresql]$ patch -p1 < pgbench-measurements-v2.patch
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file contrib/pgbench/pgbench.c
> (Stripping trailing CRs from patch; use --binary to disable.)
> patching file doc/src/sgml/pgbench.sgml

I cannot reproduce these warnings:

postgresql> git branch test
postgresql> git checkout test
Switched to branch 'test'
postgresql> patch -p1 < ../pgbench-measurements-v2.patch
patching file contrib/pgbench/pgbench.c
patching file doc/src/sgml/pgbench.sgml

Some details:

postgresql> patch --version
patch 2.6.1 [...]
postgresql> sha1sum ../pgbench-measurements-v2.patch
f095557ceae1409d2339f9d29d332cefa96e2153 [...]

--
Fabien.


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: pgbench progress report improvements
Date: 2013-09-13 04:50:56
Message-ID: CAFj8pRCMdr9O0Etwna6LC96EzFbpP+GYON1mYjZ9139amT-sfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dne 12. 9. 2013 17:34 "Fabien COELHO" <coelho(at)cri(dot)ensmp(dot)fr> napsal(a):
>
>
>> * patched with minor warning
>
>
>> some minor issue:
>>
>> patch warning
>>
>> make[1]: Leaving directory `/home/pavel/src/postgresql/config'
>> [pavel(at)localhost postgresql]$ patch -p1 < pgbench-measurements-v2.patch
>> (Stripping trailing CRs from patch; use --binary to disable.)
>> patching file contrib/pgbench/pgbench.c
>> (Stripping trailing CRs from patch; use --binary to disable.)
>> patching file doc/src/sgml/pgbench.sgml
>
>
> I cannot reproduce these warnings:
>
> postgresql> git branch test
> postgresql> git checkout test
> Switched to branch 'test'
> postgresql> patch -p1 < ../pgbench-measurements-v2.patch
> patching file contrib/pgbench/pgbench.c
> patching file doc/src/sgml/pgbench.sgml
>

it can depends on o.s. I did tests on Fedora 14. and for patching without
warning I had to use dos2unix tool.

> Some details:
>
> postgresql> patch --version
> patch 2.6.1 [...]
> postgresql> sha1sum ../pgbench-measurements-v2.patch
> f095557ceae1409d2339f9d29d332cefa96e2153 [...]
>
> --
> Fabien.


From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: pgbench progress report improvements
Date: 2013-09-13 06:51:29
Message-ID: alpine.DEB.2.02.1309130846180.26803@localhost6.localdomain6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Hello,

About patch eols:

>> postgresql> patch -p1 < ../pgbench-measurements-v2.patch
>> patching file contrib/pgbench/pgbench.c
>> patching file doc/src/sgml/pgbench.sgml
>
> it can depends on o.s. I did tests on Fedora 14. and for patching without
> warning I had to use dos2unix tool.

Hmmm. I use a Linux Ubuntu laptop, so generating DOS end of lines is
unlikely if it is not there at the beginning. Running "dos2unix" on the
patch file locally does not seem to change anything. So I assume that the
patch encoding was changed somewhere along the path you used to get it.

--
Fabien.


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: pgbench progress report improvements
Date: 2013-09-14 15:28:29
Message-ID: CAFj8pRA6ZRcgvof0U9OMRvLLenjDEo3ELp-CzopSeic6o+Qp-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/9/13 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>

>
> Hello,
>
> About patch eols:
>
>
> postgresql> patch -p1 < ../pgbench-measurements-v2.**patch
>>> patching file contrib/pgbench/pgbench.c
>>> patching file doc/src/sgml/pgbench.sgml
>>>
>>
>> it can depends on o.s. I did tests on Fedora 14. and for patching without
>> warning I had to use dos2unix tool.
>>
>
> Hmmm. I use a Linux Ubuntu laptop, so generating DOS end of lines is
> unlikely if it is not there at the beginning. Running "dos2unix" on the
> patch file locally does not seem to change anything. So I assume that the
> patch encoding was changed somewhere along the path you used to get it.
>

It is possible - but, this is only minor issue

Pavel

>
> --
> Fabien.
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: pgbench progress report improvements
Date: 2013-09-14 15:31:03
Message-ID: CAFj8pRBN8UnTe130YErxZmBsto=ibPXHCpyf9vs18T+3Jg6JoA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2013/9/12 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>

>
> Hello Pavel,
>
> Thanks for your review.
>
>
> * patched with minor warning
>> * compilable cleanly
>> * zero impact on PostgreSQL server functionality
>> * it does what was in proposal
>> ** change 5sec progress as default (instead no progress)
>> ** finalise a rate limit support - fixes a latency calculation
>>
>
> Just a point about the motivation: the rationale for having a continuous
> progress report is that benchmarking is subject to possibly long warmup
> times, and thus a test may have to run for hours so as to be significant. I
> find running a command for hours without any hint about what is going on
> quite annoying.
>
>
> * code is clean
>> * documentation is included
>> * there is no voices against this patch and this patch increases a pgbench
>> usability/
>>
>> I have only one question. When I tested this patch with throttling I got a
>> very similar values of lag.
>>
>
> Yep. That is just good!
>
>
> What is sense, or what is semantic of this value?
>>
>
> The "lag" measures the stochastic processus health. Actually, it measures
> how far behind schedule the clients are when performing throttled
> transactions. If it was to increase, that would mean that something is
> amiss, possibly not enough client threads or other issues. If it is small,
> then all is well.
>
>
> It is not detailed documented.
>>
>
> It is documented in the section about the --rate option, see
> http://www.postgresql.org/**docs/devel/static/pgbench.html<http://www.postgresql.org/docs/devel/static/pgbench.html>

ok, I see it now.

So this patch is ready for commit

Regards

Pavel

>
>
> Should be printed this value in this form on every row? We can
>> print some warning when lag is higher than latency instead?
>>
>
> Hmmm... what is important is when the lag changes values.
>
> Generally one would indeed expect that to be smaller than the latency, but
> that is not really possible when transaction are very fast, say under "-S"
> with read-only queries that hit the memory cache.
>
> Also the problem with printing warnings is that it changes the output
> format, but it seems to me more useful to print the value, so that it can
> be processed automatically and simply.
>
> Also, from a remote client perspective, say a web application, the overall
> latency is the lag plus the transaction latency: you first wait to get
> through the database (lag), and then you can perform your transaction
> (latency).
>
>
> Or we can use this value, but it should be better documented, please.
>>
>
> Is the documentation pointed above enough?
>
> --
> Fabien.
>