We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent77ae7f7 commitc2df45aCopy full SHA for c2df45a
contrib/pgbench/pgbench.c
@@ -929,13 +929,17 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
929
* that the series of delays will approximate a Poisson distribution
930
* centered on the throttle_delay time.
931
*
932
- * 1000 implies a 6.9 (-log(1/1000)) to 0.0 (log 1.0) delay multiplier.
+ * 10000 implies a 9.2 (-log(1/10000)) to 0.0 (log 1) delay multiplier,
933
+ * and results in a 0.055 % target underestimation bias:
934
+ *
935
+ * SELECT 1.0/AVG(-LN(i/10000.0)) FROM generate_series(1,10000) AS i;
936
+ * = 1.000552717032611116335474
937
938
* If transactions are too slow or a given wait is shorter than
939
* a transaction, the next transaction will start right away.
940
*/
-int64wait= (int64)
-throttle_delay*-log(getrand(thread,1,1000)/1000.0);
941
+int64wait= (int64) (throttle_delay*
942
+1.00055271703*-log(getrand(thread,1,10000)/10000.0));
943
944
thread->throttle_trigger+=wait;
945