开发者社区> 问答> 正文

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

游客886 2019-04-19 10:14:00 482

[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 点击链接欢迎加入社区大社群。

关系型数据库 PostgreSQL
分享到
取消 提交回答
全部回答(1)
  • 游客886
    2019-07-17 23:33:47

    如果CPU足够好很容易上100万

    0 0
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

推荐文章
相似问题
推荐课程