Re: Fix pgbench --progress report under (very) low rate

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix pgbench --progress report under (very) low rate
Date: 2015-04-02 18:30:30
Message-ID: CA+TgmobD0Vh_nNNt998CqoJFWNxgL=JjhMUzGunmq3HsVsJ_cA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Mar 22, 2015 at 6:12 AM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
> When running with low rate, the --progress is only printed when there is
> some activity, which makes it quite irregular, including some catching up
> with stupid tps figures.
>
> Shame on me for this "feature" (aka bug) in the first place.
>
> This patch fixes this behavior by considering the next report time as a
> target to meet as well as transaction schedule times.
>
> Before the patch:
>
> sh> ./pgbench -R 0.5 -T 10 -P 1 -S
> progress: 1.7 s, 0.6 tps, lat 6.028 ms stddev -nan, lag 1.883 ms
> progress: 2.2 s, 2.3 tps, lat 2.059 ms stddev -nan, lag 0.530 ms
> progress: 7.3 s, 0.4 tps, lat 2.944 ms stddev 1.192, lag 2.624 ms
> progress: 7.3 s, 1402.5 tps, lat 5.115 ms stddev 0.000, lag 0.000 ms
> progress: 7.3 s, 0.0 tps, lat -nan ms stddev -nan, lag inf ms
> progress: 7.3 s, 335.2 tps, lat 3.106 ms stddev 0.000, lag 0.000 ms
> progress: 8.8 s, 0.0 tps, lat -nan ms stddev -nan, lag inf ms
> progress: 8.8 s, 307.6 tps, lat 4.855 ms stddev -nan, lag 0.000 ms
> progress: 10.0 s, 0.0 tps, lat -nan ms stddev -nan, lag -nan ms
>
> After the patch:
>
> sh> ./pgbench -R 0.5 -T 10 -P 1 -S
> progress: 1.0 s, 0.0 tps, lat -nan ms stddev -nan, lag -nan ms
> progress: 2.0 s, 1.0 tps, lat 5.980 ms stddev 0.000, lag 0.733 ms
> progress: 3.0 s, 1.0 tps, lat 1.905 ms stddev 0.000, lag 0.935 ms
> progress: 4.0 s, 1.0 tps, lat 3.966 ms stddev 0.000, lag 0.623 ms
> progress: 5.0 s, 2.0 tps, lat 2.527 ms stddev 1.579, lag 0.512 ms
> progress: 6.0 s, 0.0 tps, lat -nan ms stddev -nan, lag -nan ms
> progress: 7.0 s, 0.0 tps, lat -nan ms stddev -nan, lag -nan ms
> progress: 8.0 s, 1.0 tps, lat 1.750 ms stddev 0.000, lag 0.767 ms
> progress: 9.0 s, 0.0 tps, lat -nan ms stddev -nan, lag -nan ms
> progress: 10.0 s, 2.0 tps, lat 2.403 ms stddev 1.386, lag 0.357 ms

I haven't had time to really review the code here (except to notice
that you have a typo: "nedded") but the idea of it seems good.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-04-02 18:40:03 Re: Something is rotten in the state of Denmark...
Previous Message Robert Haas 2015-04-02 18:27:56 Re: Remove fsync ON/OFF as a visible option?