您的位置:首页 > 运维架构

sysbench 测试IOPS

2015-12-27 00:00 477 查看
1、选择测试的磁盘

[root@166087 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/simfs      150G   32G  119G  22% /
none            1.0G  4.0K  1.0G   1% /dev
none            1.0G     0  1.0G   0% /dev/shm


2、测试命令,生成测试文件

[root@166087 ~]# mkdir sysbench_test
[root@166087 ~]# sysbench --test=fileio --file-num=4 --file-total-size=10G --file-block-size=16384 --file-test-mode=rndrd --max-requiest=0 --max-time=3600 --num-threads=16 prepare
sysbench: /usr/lib64/libmysqlclient.so.18: no version information available (required by sysbench)
sysbench 0.5:  multi-threaded system evaluation benchmark
4 files, 2621440Kb each, 10240Mb total
Creating files for the test...
Extra file open flags: 0
Creating file test_file.0
Creating file test_file.1
Creating file test_file.2
Creating file test_file.3
10737418240 bytes written in 50.91 seconds (201.13 MB/sec).


3、测试

[root@166087 ~]# sysbench --test=fileio --file-num=4  --file-total-size=10G --file-block-size=16384 --file-test-mode=rndrd --max-request=0 --max-time=3600  --file-extra-flags=direct --num-threads=16 --report-interval=3 run
sysbench: /usr/lib64/libmysqlclient.so.18: no version information available (required by sysbench)
sysbench 0.5:  multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 16
Report intermediate results every 3 second(s)
Random number generator seed is 0 and will be ignored
Extra file open flags: 3
4 files, 2.5Gb each
10Gb total file size
Block size 16Kb
Number of IO requests: 10000
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random read test
Threads started!
Operations performed:  10000 reads, 0 writes, 0 Other = 10000 Total
Read 156.25Mb  Written 0b  Total transferred 156.25Mb  (3.3248Gb/sec)
217895.03 Requests/sec executed  #IOPS
General statistics:
total time:                          0.0459s
total number of events:              10000
total time taken by event execution: 0.2083s
response time:
min:                                  0.00ms
avg:                                  0.02ms
max:                                 13.86ms
approx.  95 percentile:               0.01ms
Threads fairness:
events (avg/stddev):           625.0000/444.87
execution time (avg/stddev):   0.0130/0.01


4、注意事项:

测试时间要够长几天一周的样子,测试文件要够大。至少硬盘容量的60-%80%。
如果是测试数据库的写入, --file-block-size=16384 应该设置数据库的  innodb_page_size 大小
清除测试文件 sysbench --test=fileio --file-num=4 --file-total-size=10G --file-block-size=16384 --file-test-mode=rndrd --max-requiest=0 --max-time=3600 --num-threads=16 cleanup
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: