您的位置:首页 > 其它

Sysbench对磁盘IO进行性能测试

2017-07-08 23:48 387 查看
Sysbench 是一种系统性能 benchmark

SysBench 是一款开源的、跨平台的、模块化的、多线程的性能测试工具, 通过高负载地运行在数据库上, 可以执行 CPU/内存/线程/IO/数据库 等方面的性能测试. 用于评估操作系统的性能参数.

主要用于评估测试各种不同系统参数下的数据库负载情况. 它主要包括以下几种方式的测试 :

编号 测试

1 cpu 性能

2 磁盘io性能

3 调度程序性能

4 内存分配及传输速度

5 POSIX 线程性能

6 数据库性能(OLTP基准测试)

介绍来自:https://github.com/gatieme/AderXCoding/tree/master/system/tools/benchmark/sysbench

这节先对磁盘做测试

[root@centos01 ~]# wget https://github.com/akopytov/sysbench/archive/0.5.zip
[root@centos01 ~]# unzip 0.5.zip

[root@centos01 ~]# cd sysbench-0.5

[root@centos01 sysbench-0.5]# yum -y install gcc gcc-c++ autoconf automake libtool*

[root@centos01 sysbench-0.5]# ./autogen.sh

[root@centos01 sysbench-0.5]# ./configure --without-mysql --这里先不考虑mysql模块

[root@centos01 sysbench-0.5]# make

[root@centos01 sysbench-0.5]# cd sysbench/

[root@centos01 sysbench-0.5]# ./sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw prepare

[root@centos01 sysbench-0.5]# ./sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw run



可以看到随机写性能 84.92Mb/sec,随机读性能5434.86 Requests/sec

-- 清理数据

[root@centos01 sysbench-0.5]# ./sysbench --test=fileio --num-threads=16 --file-total-size=3G --file-test-mode=rndrw cleanup

当编译支持mysql后,同样可以通过命令方便的测试mysql性能:

sysbench --test=oltp --mysql-table-engine=myisam --oltp-table-size=1000000 \

--mysql-socket=/tmp/mysql.sock --mysql-user=test --mysql-host=localhost \

--mysql-password=test prepare
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: