sysbench--实践--01--文件IO测试

sysbench–实践–01–文件IO测试


1、介绍

  1. 磁盘IO性能测试
  2. 主要性能指标:请求数(request)和总体的吞吐量(total)。

2、参数说明

sysbench --test=fileio help

2.1、–file-num=N

  1. 创建文件的数量
  2. 默认值:128。

2.2、–file-block-size=N

  1. 每次IO操作的block大小
  2. 默认值:16K。

2.3、–file-total-size=SIZE

  1. 所有文件大小总和
  2. 默认值:2G。

2.4、–file-test-mode=STRING

测试模式:
1. seqwr(顺序写)
2. seqrewr(顺序读写)
3. seqrd(顺序读)
4. rndrd(随机读)
5. rndwr(随机写)
6. rndrw(随机读写)。

2.5、–file-io-mode

  1. 文件操作模式:
    1. sync(同步)
    2. async(异步)
    3. mmap(快速map映射)
  2. 默认值:sync。

2.6、–file-async-backlog

number of asynchronous operatons to queue per thread [128]。

2.7、–file-extra-flags=STRING

使用额外的标志符来打开文件{sync,dsync,direct}。

2.8、–file-fsync-freq=N

  1. 在完成N次请求之后,执行fsync()
  2. 0表示不使用fsync
  3. 默认值:100。

2.9、–file-fsync-all=[on|off]

  1. 每次写操作后执行fsync()
  2. 默认值:off。

2.10、–file-fsync-end=[on|off]

  1. 测试结束后执行fsync()
  2. 默认值:on。

2.11、–file-fsync-mode=STRING

  1. 使用fsync或fdatasync方法进行同步
  2. 默认值:fsync。

2.12、–file-merged-requests=N

  1. 尽可能的合并N个IO请求数
  2. 0表示不合并
  3. 默认值:0。

2.13、–file-rw-ratio=N

  1. 测试时候的读写比例
  2. 默认值:1.5(即3:2)。

3、操作

3.1、IO测试,线程数为4,创建大小为1G的测试文件,使用了随机读写模式

命令

# 准备阶段:IO测试,线程数为4,创建大小为1G的测试文件,使用了随机读写模式(rndrw),执行完后会在当前目录下生成一堆小文件。
sysbench  fileio --threads=4 --file-total-size=1G --file-test-mode=rndrw prepare

# 运行阶段:IO测试,线程数为4,创建大小为1G的测试文件,使用了随机读/写(rndrw)
sysbench  fileio --threads=4 --file-total-size=1G --file-test-mode=rndrw run


结果
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 4
Initializing random number generator from current time


Extra file open flags: (none)
128 files, 8MiB each
1GiB total file size
Block size 16KiB
Number of IO requests: 0
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 r/w test
Initializing worker threads...

Threads started!


File operations:
    reads/s:                      10485.52
    writes/s:                     6990.35
    fsyncs/s:                     22414.18

Throughput:
    read, MiB/s:                  163.84  # 表示读的带宽
    written, MiB/s:               109.22  # 表示写的带宽

General statistics:
    total time:                          10.0050s
    total number of events:              398711

Latency (ms):
         min:                                    0.00
         avg:                                    0.10
         max:                                   18.66
         95th percentile:                        0.62
         sum:                                39603.46

Threads fairness:
    events (avg/stddev):           99677.7500/2639.39
    execution time (avg/stddev):   9.9009/0.00

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值