此次的基准测试,通过sysbench工具完成,主要对比组也是通过去租参数去完成,并对照结果。
对比参数
innodb_flush_log_at_trx_commit
sync-binlog
1组 | innodb_flush_log_at_trx_commit = 2 |
sync-binlog = 1 | |
2组 | innodb_flush_log_at_trx_commit = 2 |
sync-binlog = 0 |
sysbench参数:
1组 | oltp_tables_count=15 |
oltp-table-size=10000000 | |
num-threads=128 | |
oltp-read-only=off | |
rand-type=uniform | |
max-time=1500 | |
percentile=99 | |
2组 | oltp_tables_count=15 |
oltp-table-size=10000000 | |
num-threads=128 | |
oltp-read-only=off | |
rand-type=uniform | |
max-time=1500 | |
percentile=99 |
测试结果:
1组 | read | 31575810 | |
write | 9021660 | ||
other | 4510830 | ||
total | 45108300 | ||
transactions | 2255415 (1503.56 per sec.) | ||
deadlocks | 0 (0.00 per sec.) | ||
read/write requests | 40597470 (27063.99 per sec.) | ||
other operations | 4510830 (3007.11 per sec.) | ||
response time | min | 7.34ms | |
avg | 85.12ms | ||
max | 8072.93ms | ||
99 percentile | 351.16ms | ||
2组 | read | 42732508 | |
write | 12209288 | ||
other | 6104644 | ||
total | 61046440 | ||
transactions | 3052322 (2034.75 per sec.) | ||
deadlocks | 0 (0.00 per sec.) | ||
read/write requests | 54941796 (36625.46 per sec.) | ||
other operations | 6104644 (4069.50 per sec.) | ||
response time | min | 3.33ms | |
avg | 62.90ms | ||
max | 19946.42ms | ||
99 percentile | 204.27ms |
测试结论:
通过2组对比测试,当sync-binlog为1时,mysql性能显著的下降,下降约(2034.75-1503.56)/2034.75*100%=26.11%。这个是sysbench测试的结果,tpcc-mysql测试的性能下降比这个要小很多,约10%左右。