1. 下载sysbench的文件
https://codeload.github.com/akopytov/sysbench/zip/1.0.15
2. 放进linux机器以及进行解压缩
unzip
3.生成configure 文件
./autogen.sh
4. 安装
./configure --prefix=/usr/local/sysbench --without-mysql --不适用mysql
make
make install
ln /usr/local/sysbench/bin/sysbench /usr/bin/sysbench
5. 进行检查测试
sysbench --test=fileio --file-num=10 --file-total-size=1G --file-block-size=4096 --file-test-mode=seqwr --file-io-mode=sync prepare sysbench --test=fileio --file-num=10 --file-total-size=1G --file-block-size=4096 --file-test-mode=seqwr --file-io-mode=sync run sysbench --test=fileio --file-num=10 --file-total-size=1G --file-block-size=4096 --file-test-mode=seqwr --file-io-mode=sync cleanup
6. 对有无快照的虚拟机 进行 随机读写测试, 命令
sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw prepare sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw run sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw cleanup
三个快照的结果
File operations: reads/s: 114.27 writes/s: 75.92 fsyncs/s: 430.55 Throughput: read, MiB/s: 1.79 written, MiB/s: 1.19 General statistics: total time: 10.4033s total number of events: 4411 Latency (ms): min: 0.00 avg: 36.51 max: 5962.82 95th percentile: 87.56 sum: 161035.85 Threads fairness: events (avg/stddev): 275.6875/129.27 execution time (avg/stddev): 10.0647/0.15
一个快照的结果
File operations: reads/s: 146.95 writes/s: 97.80 fsyncs/s: 508.59 Throughput: read, MiB/s: 2.30 written, MiB/s: 1.53 General statistics: total time: 10.2125s total number of events: 5647 Latency (ms): min: 0.00 avg: 28.01 max: 4115.60 95th percentile: 71.83 sum: 158148.92 Threads fairness: events (avg/stddev): 352.9375/166.15 execution time (avg/stddev): 9.8843/0.15