Sysbench使用之二fileio

简介: 源码编译的安装步骤如下

源码安装

安装方法参见: https://github.com/akopytov/sysbench

源码编译的安装步骤如下:


yum -y install make automake libtool pkgconfig libaio-devel  openssl-devel
wget https://github.com/akopytov/sysbench/archive/master.zip
unzip master.zip 
cd sysbench-master/
./autogen.sh 
./configure  --without-mysql
 make -j
 make install


没有安装mysql,所以要用–without-mysql。


fileio 测试

# sysbench fileio help
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
fileio options:
  --file-num=N                  number of files to create [128]
  --file-block-size=N           block size to use in all IO operations [16384]
  --file-total-size=SIZE        total size of files to create [2G]
  --file-test-mode=STRING       test mode {seqwr, seqrewr, seqrd, rndrd, rndwr, rndrw}
  --file-io-mode=STRING         file operations mode {sync,async,mmap} [sync]
  --file-async-backlog=N        number of asynchronous operatons to queue per thread [128]
  --file-extra-flags=[LIST,...] list of additional flags to use to open files {sync,dsync,direct} []
  --file-fsync-freq=N           do fsync() after this number of requests (0 - don't use fsync()) [100]
  --file-fsync-all[=on|off]     do fsync() after each write operation [off]
  --file-fsync-end[=on|off]     do fsync() at the end of test [on]
  --file-fsync-mode=STRING      which method to use for synchronization {fsync, fdatasync} [fsync]
  --file-merged-requests=N      merge at most this number of IO requests if possible (0 - don't merge) [0]
  --file-rw-ratio=N             reads/writes ratio for combined test [1.5]


# sysbench fileio prepare
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
128 files, 16384Kb each, 2048Mb total
Creating files for the test...
...
Creating file test_file.127
2147483648 bytes written in 4.26 seconds (481.08 MiB/sec).


飞腾机器测试顺序写大约400M/S:


# sysbench fileio  --file-test-mode=seqwr run
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Extra file open flags: (none)
128 files, 16MiB each
2GiB total file size
Block size 16KiB
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing sequential write (creation) test
Initializing worker threads...
Threads started!
Throughput:
         read:  IOPS=0.00 0.00 MiB/s (0.00 MB/s)
         write: IOPS=25040.09 391.25 MiB/s (410.26 MB/s)
         fsync: IOPS=32061.56
Latency (ms):
         min:                                  0.00
         avg:                                  0.02
         max:                                 55.21
         95th percentile:                      0.05
         sum:                               9695.04
[root@localhost infokist]#

这是一个由11个sata盘组成的RAID 6的磁盘整列。


# sysbench fileio  --file-test-mode=rndrd run
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Extra file open flags: (none)
128 files, 16MiB each
2GiB 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 read test
Initializing worker threads...
Threads started!
Throughput:
         read:  IOPS=19340.10 302.19 MiB/s (316.87 MB/s)
         write: IOPS=0.00 0.00 MiB/s (0.00 MB/s)
         fsync: IOPS=0.00
Latency (ms):
         min:                                  0.01
         avg:                                  0.05
         max:                                  0.25
         95th percentile:                      0.07
         sum:                               9828.43



只读的iops将近2万

测试完成要删除用于测试的文件

# sysbench fileio  cleanup
sysbench 1.1.0 (using bundled LuaJIT 2.1.0-beta3)
Removing test files...


其他测试

# sysbench threads run

# sysbench memory run

# sysbench cpu run

# sysbench mutex run

相关文章
|
5月前
|
关系型数据库 MySQL 测试技术
压测工具sysbench的使用
压测工具sysbench的使用
173 0
|
存储 关系型数据库 测试技术
|
SQL 缓存 Oracle
Sysbench测试神器:一条命令生成百万级测试数据
Sysbench测试神器:一条命令生成百万级测试数据
1409 0
Sysbench测试神器:一条命令生成百万级测试数据
|
关系型数据库 测试技术 OLTP
PosgreSQL快速参数调优和sysbench压测
关于PostgreSQL的性能调优可以参考《PostgreSQL 9.0 High Performance》,以及朱贤文在2014 PostgreSQL中国用户大会上分享的《高性能Postgres 最佳实践》。
1736 0
|
测试技术 OLTP
sysbench的压测工具的安装与使用
sysbench的压测工具的安装与使用
208 0
|
测试技术 Shell
如何用sysbench做好IO性能测试
sysbench 是一个非常经典的综合性能测试工具,通常都用它来做数据库的性能压测,但也可以用来做CPU,IO的性能测试。最近碰到一个客户比较轴,一定要用sysbench来测IO,不是很推荐用这个工具来测IO,倒不是说它有错误,工具本身没有任何问题,它的测试方法导致测试的数据会让人有些困惑:性能数据到底是不是这样呢,跟云厂商承诺的性能有关系嘛。
4171 0
|
关系型数据库 MySQL 测试技术
|
关系型数据库 MySQL 测试技术
|
固态存储 关系型数据库 测试技术

热门文章

最新文章