Re: pgbench throttling latency limit

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Jan Wieck <jan(at)wi3ck(dot)info>, Rukh Meski <rukh(dot)meski(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench throttling latency limit
Date: 2014-09-10 14:57:14
Message-ID: alpine.DEB.2.10.1409101637540.306@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Heikki,

> I looked closer at the this, and per Jan's comments, realized that we don't
> log the lag time in the per-transaction log file. I think that's a serious
> omission; when --rate is used, the schedule lag time is important information
> to make sense of the result. I think we have to apply the attached patch, and
> backpatch to 9.4. (The documentation on the log file format needs updating)

Indeed. I think that people do not like it to change. I remember that I
suggested to change timestamps to "xxxx.yyyyyy" instead of the unreadable
"xxxx yyy", and be told not to, because some people have tool which
process the output so the format MUST NOT CHANGE. So my behavior is not to
avoid touching anything in this area.

I'm fine if you do it, though:-) However I have not time to have a precise
look at your patch to cross-check it before Friday.

> Also, this is bizarre:
>
>> int64 wait = (int64) (throttle_delay *
>> 1.00055271703 * -log(getrand(thread, 1, 10000) / 10000.0));
>
> We're using getrand() to generate a uniformly distributed random value
> between 1 and 10000, and then convert it to a double between 0.0 and 1.0.

The reason for this conversion is to have randomness but to still avoid
going to extreme multiplier values. The idea is to avoid a very large
multiplier which would generate (even if it is not often) a 0 tps when 100
tps is required. The 10000 granularity is basically random but the
multiplier stays bounded (max 9.2, so the minimum possible tps would be
around 11 for a target of 100 tps, bar issues from the database for
processing the transactions).

So although this feature can be discussed and amended, it is fully
voluntary. I think that it make sense so I would prefer to keep it as is.
Maybe the comments could be update to be clearer.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-09-10 14:57:57 Re: Spinlocks and compiler/memory barriers
Previous Message Mitsumasa KONDO 2014-09-10 14:47:06 Re: pgbench throttling latency limit