Sysbench对磁盘IO进行性能测试

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


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值