我正在尝试使用pgbench在postgreSQL的PolarDB上执行一个测试。
这是我用来执行测试的命令。
pgbench -M prepared -r -c 16 -j 4 -T 30 -p 10001 -d pgbench -l这就是结果
... ...
client 2 sending P0_10
client 2 receiving
client 2 receiving
client 14 receiving
transaction type: <builtin: TPC-B (sort of)>
scaling factor: 32
query mode: prepared
number of clients: 16
number of threads: 4
duration: 30 s
number of transactions actually processed: 49126
latency average = 9.772 ms
tps = 1637.313156 (including connections establishing)
tps = 1637.438330 (excluding connections establishing)
statement latencies in milliseconds:
1.128 \set aid random(1, 100000 * :scale)
0.068 \set bid random(1, 1 * :scale)
0.040 \set tid random(1, 10 * :scale)
0.041 \set delta random(-5000, 5000)
0.104 BEGIN;
3.815 UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
0.590 SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
1.188 UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
1.440 UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
0.327 INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
0.481 END;我想知道是否有一种方法可以从结果中计算P99,或者是否有一些额外的参数需要提供给pgbench?
发布于 2021-07-13 22:39:27
-l导致它写入日志文件。您需要查看这些日志文件中的延迟。对我来说,这看起来像这样:
cat pgbench_log.107915*|wc
36635 219810 1033548
sort pgbench_log.107915* -k3rn|head -n 366|tail -n 1
13 990 65184 0 195589 166574所以大约65.184毫秒是99%的延迟。不过,我会质疑这是否真的意味着什么。毕竟,最后一个事务必须等待近30秒才能打开服务器,那么为什么它的“延迟”不是30秒呢?那么那些从来没有轮到他们的交易呢?
https://stackoverflow.com/questions/68357778
复制相似问题