-性能测试对比-pgbench-postgresql高可用对比

时间:2024-05-15 15:14:54
【文件属性】:

文件名称:-性能测试对比-pgbench-postgresql高可用对比

文件大小:6.49MB

文件格式:PPT

更新时间:2024-05-15 15:14:54

postgresql

04-性能测试对比-pgbench 通过pgbench在postgresql上运行做的基准测试。它能够并发的在数据库会话中一遍一遍的运行相同序列的SQL命令,并且计算平均事务率(每秒事务数tps)。Pgbench测试的一种基于TPC-B但是更宽松的场景。如下pgbench的模型 Branches S*1 Tellers S*10 Accounts S*100000 History S*0 Pgbench实际执行的事务 \set aid random(1, 100000 * :scale) \set bid random(1, 1 * :scale) \set tid random(1, 10 * :scale) \set delta random(-5000, 5000) BEGIN; UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; SELECT abalance FROM pgbench_accounts WHERE aid = :aid; UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); END; *


网友评论