开发者社区> 问答> 正文

1百万数据点查, 你是怎么做到69万的tps的

[postgres@cnsz92pl00192 data]$pgbench -M prepared -h 127.0.0.1 -p 10002 -n -r -f ~/data/test.sql -c 64 -j 64 -T 10
transaction type: /home/postgres/data/test.sql
scaling factor: 1
query mode: prepared
number of clients: 64
number of threads: 64
duration: 10 s
number of transactions actually processed: 49050
latency average = 13.107 ms
tps = 4882.839136 (including connections establishing)
tps = 8783.875162 (excluding connections establishing)
statement latencies in milliseconds:

     0.002  \set id random(1,1000000)  
     7.225  select id from tbl_ip where id=:id;

[postgres@cnsz92pl00192 data]$pgbench -M prepared -h 127.0.0.1 -p 10002 -n -r -f ~/data/test.sql -c 64 -j 64 -T 20
transaction type: /home/postgres/data/test.sql
scaling factor: 1
query mode: prepared
number of clients: 64
number of threads: 64
duration: 20 s
number of transactions actually processed: 95789
latency average = 13.400 ms
tps = 4776.021870 (including connections establishing)
tps = 8375.462545 (excluding connections establishing)
statement latencies in milliseconds:

     0.002  \set id random(1,1000000)  
     7.583  select id from tbl_ip where id=:id;

[postgres@cnsz92pl00192 data]$pgbench -M prepared -h 127.0.0.1 -p 10002 -n -r -f ~/data/test.sql -c 128 -j 128 -T 20
transaction type: /home/postgres/data/test.sql
scaling factor: 1
query mode: prepared
number of clients: 128
number of threads: 128
duration: 20 s
number of transactions actually processed: 105182
latency average = 24.477 ms
tps = 5229.411053 (including connections establishing)
tps = 18263.330523 (excluding connections establishing)
statement latencies in milliseconds:

     0.001  \set id random(1,1000000)  
     6.890  select id from tbl_ip where id=:id;

8

本问题来自云栖社区【PostgreSQL技术进阶社群】。https://yq.aliyun.com/articles/690084 点击链接欢迎加入社区大社群。

展开
收起
游客886 2019-04-19 10:14:00 3176 0
1 条回答
写回答
取消 提交回答
  • 如果CPU足够好很容易上100万

    2019-07-17 23:33:47
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
亿级pv网站架构实战之性能压榨 立即下载
亿级 PV网站架构实战之性能压榨 立即下载
双11万亿流量下的分布式缓存 立即下载