首页 > 其他分享 >Sysbench 开启超线程/关闭超线程性能损耗

Sysbench 开启超线程/关闭超线程性能损耗

时间:2023-02-18 12:55:23浏览次数:41  
标签:10 损耗 99% pgsql -- ms 超线程 Sysbench

摘要

Stress-NG 测试完之后
突然想 使用sysbenchen也进行一次压测
验证一把 超线程对数据的性能影响. 

压测命令

./sysbench \
--db-driver=pgsql \
--pgsql-host=10.24.2x.xx \
--pgsql-port=5432 \
--pgsql-user=xxxx \
--pgsql-password=password \
--pgsql-db=postgres \
--threads=10 --time=30 \
--events=0 \
--report-interval=10 \
--percentile=99    ../share/sysbench/oltp_read_write.lua  \
prepare

./sysbench \
--db-driver=pgsql \
--pgsql-host=10.24.2x.xx \
--pgsql-port=5432 \
--pgsql-user=xxxx \
--pgsql-password=password \
--pgsql-db=postgres \
--threads=10 --time=30 \
--events=0 \
--report-interval=10 \
--percentile=99    ../share/sysbench/oltp_read_write.lua  \
run

./sysbench \
--db-driver=pgsql \
--pgsql-host=10.24.2x.xx \
--pgsql-port=5432 \
--pgsql-user=xxxx \
--pgsql-password=password \
--pgsql-db=postgres \
--threads=10 --time=30 \
--events=0 \
--report-interval=10 \
--percentile=99    ../share/sysbench/oltp_read_write.lua  \
cleanup

结果分析

是否开启超线程 事务效率(每秒) 查询效率(每秒) 最小响应时间(ms) 平均响应时间 99%的响应时间
是 32核心/64线程 211.63 4329.45 20.03 47.22 102.97
否 32核心/32线程 217.78 4459.01 16.59 45.89 139.85
关闭超线程提升 103% 103% 120% 103% 74%

注意1 效率提示部分 我都换算成了越大越好

注意2 除了99%响应时间,关闭超线程对数据库都有大约3%的性能提升


开启超线程的结果

[ 10s ] thds: 10 tps: 184.66 qps: 3794.17 (r/w/o: 2665.11/740.54/388.51) lat (ms,99%): 909.80 err/s: 4.90 reconn/s: 0.00
[ 20s ] thds: 10 tps: 204.91 qps: 4186.76 (r/w/o: 2938.01/819.93/428.82) lat (ms,99%): 114.72 err/s: 5.00 reconn/s: 0.00
[ 30s ] thds: 10 tps: 244.90 qps: 5016.71 (r/w/o: 3519.61/982.40/514.70) lat (ms,99%): 80.03 err/s: 6.30 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            91238
        write:                           25439
        other:                           13332
        total:                           130009
    transactions:                        6355   (211.63 per sec.)
    queries:                             130009 (4329.45 per sec.)
    ignored errors:                      162    (5.39 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          30.0274s
    total number of events:              6355

Latency (ms):
         min:                                   20.03
         avg:                                   47.22
         max:                                 1124.25
         99th percentile:                      102.97
         sum:                               300089.92

Threads fairness:
    events (avg/stddev):           635.5000/10.03
    execution time (avg/stddev):   30.0090/0.01

关闭超线程的结果

[ 10s ] thds: 10 tps: 185.66 qps: 3793.26 (r/w/o: 2662.08/740.56/390.62) lat (ms,99%): 893.56 err/s: 4.20 reconn/s: 0.00
[ 20s ] thds: 10 tps: 243.81 qps: 5002.51 (r/w/o: 3511.78/975.32/515.41) lat (ms,99%): 81.48 err/s: 6.40 reconn/s: 0.00
[ 30s ] thds: 10 tps: 223.70 qps: 4590.28 (r/w/o: 3222.39/893.50/474.40) lat (ms,99%): 144.97 err/s: 6.70 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            94010
        write:                           26123
        other:                           13815
        total:                           133948
    transactions:                        6542   (217.78 per sec.)
    queries:                             133948 (4459.01 per sec.)
    ignored errors:                      173    (5.76 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          30.0383s
    total number of events:              6542

Latency (ms):
         min:                                   16.59
         avg:                                   45.89
         max:                                 1103.25
         99th percentile:                      139.85
         sum:                               300197.16

Threads fairness:
    events (avg/stddev):           654.2000/15.81
    execution time (avg/stddev):   30.0197/0.01

标签:10,损耗,99%,pgsql,--,ms,超线程,Sysbench
From: https://www.cnblogs.com/jinanxiaolaohu/p/17132362.html

相关文章