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

相关文章
|
4天前
|
SQL Oracle 关系型数据库
Mysql性能优化这5点你知道吗?简单却容易被初学者忽略!
在日常工作中,我们常用的数据库无非是Mysql、Oracle、SqlServer、DB2这几种(仅针对关系型数据库中),对于我们来说,数据库的性能优化是一个重点问题,也是很多公司面试时喜欢提及的,这里总结了一些比较常见,但又相对容易忽略的部分,供大家批判学习。
12 2
|
2月前
|
关系型数据库 OLAP OLTP
PostgreSQL从小白到高手教程 - 第45讲:poc-tpcc测试
CUUG PostgreSQL技术大讲堂系列公开课第45讲-POC-TPCC测试的内容,往期视频及文档,请联系CUUG。
45 1
|
存储 关系型数据库 测试技术
|
缓存 关系型数据库 MySQL
MySQL 脚本优化工具tuning-primer.sh使用教程说明
今天推荐给大家一个不错的脚本tuning-primer.sh,可以帮助我们去查看一下msyql的运行情况,产生报告和给出一些建议,我们可以根据这些建议,结合mysql服务器的实际情况,对mysql进行优化。
1349 0
|
关系型数据库 MySQL 测试技术
|
关系型数据库 MySQL 测试技术
|
关系型数据库 MySQL 测试技术
|
关系型数据库 测试技术 数据库
|
固态存储 关系型数据库 测试技术