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 |
否 32核心/32线程 | 244.78 | 5011.98 | 14.43 | 40.82 | 97.55 |
关闭超线程提升 | 103% | 103% | 120% | 103% | 74% |
本地部署vsdocker | 112% | 112% | 115% | 112% | 143% |
注意1 效率提示部分 我都换算成了越大越好
注意2 除了99%响应时间,关闭超线程对数据库都有大约3%的性能提升
注意3 使用apt 本地文件部署. 比使用docker部署性能提升12%
本地文件启动命令, 注意ubuntu的不挑一样
/usr/lib/postgresql/10/bin/pg_ctl -D /var/lib/postgresql/10/main -l logfile restart
[ 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
[ 10s ] thds: 10 tps: 243.35 qps: 4991.08 (r/w/o: 3504.25/972.02/514.80) lat (ms,99%): 82.96 err/s: 6.10 reconn/s: 0.00
[ 20s ] thds: 10 tps: 288.50 qps: 5892.27 (r/w/o: 4134.45/1152.11/605.71) lat (ms,99%): 68.05 err/s: 6.90 reconn/s: 0.00
[ 30s ] thds: 10 tps: 202.30 qps: 4163.91 (r/w/o: 2923.90/814.10/425.90) lat (ms,99%): 893.56 err/s: 6.50 reconn/s: 0.00
SQL statistics:
queries performed:
read: 105658
write: 29400
other: 15475
total: 150533
transactions: 7352 (244.78 per sec.)
queries: 150533 (5011.98 per sec.)
ignored errors: 195 (6.49 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 30.0331s
total number of events: 7352
Latency (ms):
min: 14.43
avg: 40.82
max: 2938.61
99th percentile: 97.55
sum: 300120.33
Threads fairness:
events (avg/stddev): 735.2000/39.34
execution time (avg/stddev): 30.0120/0.01