Re: pgbench throttling latency limit

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, 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-12 14:38:17
Message-ID: 54130559.9030602@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/11/2014 03:36 PM, Fabien COELHO wrote:
>
> Hello Heikki,
>
>> Now that I've finished the detour and committed and backpatched the changes
>> to the way latency is calculated, we can get back to this patch. It needs to
>> be rebased.
>
> Before rebasing, I think that there are a few small problems with the
> modification applied to switch from an integer range to double.
>
> (1) ISTM that the + 0.5 which remains in the PoissonRand computation comes
> from the previous integer approach and is not needed here. If I'm not
> mistaken the formula should be plain:
>
> -log(uniform) * center

No. The +0.5 is to round the result to the nearest integer, instead of
truncating it down.

> (2) I'm not sure of the name "center", I think that "lambda" or
> "mean" would be more appropriate.

(shrug), I guess. The comment says that it's the value the average of a
series values is centered on, so "center" doesn't seem too bad. I guess
the mathematically accurate term would be "expected value".

> (3) I wish that the maximum implied multiplier could be explicitely
> documented in the source code. From pg_rand48 source code, I think
> that it is 33.27106466687737

Oh, ok. That's an even smaller multiplier than I got just by feeding
DBL_MIN to the formula. I don't think that's worth worrying about. That
might change if the implementation of pg_erand48() is changed, so I'm a
bit reluctant to state it explicitly.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2014-09-12 14:44:27 Re: ALTER SYSTEM RESET?
Previous Message Stephen Frost 2014-09-12 14:37:02 Re: expanded mode is still broken