sysbench --test=cpu --cpu-max-prime=20000 run --num-threads=5 #执行cpu的性能测试,测试素数最大为20000, 线程数为5
--percentile 95%:响应时间,也就是删除5%的响应时间最长的请求,而后从剩余的请求中选取最大的响应时间值 --max-time:运行时间限制,单位是秒 --num-threads: 线程数 --max-requests: 查询数限制
--num-thread=16 #指定了最大建立16个线程 --file-total-size=12G #参数指定建立的文档总大小12GB --file-test-mode=rndrw #指定文档的读写模式为随机读写
磁盘io性能测试是进行数据库基准测试要着重加以研究的,咱们须要衡量各类因素,好比:mysql
操做类型、读写的频率、IO大小、是随机读写仍是顺序读写、写的类型是异步仍是同步、并发线程状况、操做系统缓存状态及文件系统有哪些调优因素。sql
文件测试类型有:数据库
seqwr顺序写、seqrewr顺序重写、seqrd顺序读、rndrd随机读、rndwr随机写、rndrw随机读写ubuntu
sysbench --test=fileio --num-threads=16 --file-total-size=12G --file-test-mode=rndrw prepare #准备数据 sysbench --test=fileio --num-threads=16 --file-total-size=12G --file-test-mode=rndrw run #执行测试 sysbench --test=fileio --num-threads=16 --file-total-size=12G --file-test-mode=rndrw cleanup #清除测试数据
sysbench --test=memory --memory-block-size=8K --memory-total-size=4G run
<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">缓存