打开执行计划器缓存:
sysbench /usr/local/share/sysbench/oltp_write_only.lua --mysql-host=127.0.0.1 --mysql-port=15306 --mysql-user=root --mysql-password= --mysql-db=customer --report-interval=10
100s
sysbench /usr/local/share/sysbench/oltp_read_only.lua --mysql-host=127.0.0.1 --mysql-port=15306 --mysql-user=root --mysql-password= --mysql-db=customer --report-interval=10
100s
关闭执行计划器缓存
在启动项中设置:gate_query_cache_size = 0
sysbench /usr/local/share/sysbench/oltp_write_only.lua --mysql-host=127.0.0.1 --mysql-port=15306 --mysql-user=root --mysql-password= --mysql-db=customer --report-interval=10
30s
100s
sysbench /usr/local/share/sysbench/oltp_read_only.lua --mysql-host=127.0.0.1 --mysql-port=15306 --mysql-user=root --mysql-password= --mysql-db=customer --report-interval=10
30s
100s
由此看来,
打开计划缓存,写的效率影响不大,但是读的效率提升近40~50%