Sysbench在centos系统下的安装
测试环境:
CentOS-7-x86_64-DVD-1503-01.iso
下载地址:
http://vault.centos.org/7.1.1503/isos/x86_64/
sysbench-0.4.12.10.tar.gz
下载地址:
入口:http://dev.mysql.com/downloads/benchmarks.html
http://downloads.mysql.com/source/sysbench-0.4.12.10.tar.gz
依赖rpm包
MySQL-devel-5.5.28-1.linux2.6.x86_64.rpm
MySQL-shared-5.5.53-1.linux2.6.x86_64.rpm
下载地址:http://mirrors.sohu.com/mysql/MySQL-5.5/
rpm包统一下载地址:http://pan.baidu.com/s/1boUDxRD
安装步骤:
1、安装gcc-c++(如果没安装的话
# yum install gcc-c++
2、安装rpm依赖包
# rpm -ivh MySQL-devel-5.5.28-1.linux2.6.x86_64.rpm
# rpm -ivh MySQL-shared-5.5.53-1.linux2.6.x86_64.rpm
3、安装sysbench
# tar -xvzf sysbench-0.4.12.10.tar.gz
# cd sysbench-0.4.12.10/
# ./configure --prefix=/usr/local/sysbench --build=x86_64
注:如果不添加--build=x86_64可能会提示如下错误:
checking build system type... Invalid configuration `x86_64-unknown-linux-': machine `x86_64-unknown-linux' not recognized
configure: error: /bin/sh config/config.sub x86_64-unknown-linux- failed
# make && make install
4、验证是否安装成功
# cd /usr/local/sysbench/bin
# ./sysbench --version
sysbench 0.4.12.10
# ./sysbench --test=cpu run
sysbench 0.4.12.10: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Random number generator seed is 0 and will be ignored
Doing CPU performance benchmark
Primer numbers limit: 10000
Threads started!
Done.
General statistics:
total time: 7.7932s
total number of events: 10000
total time taken by event execution: 7.7824
response time:
min: 0.71ms
avg: 0.78ms
max: 9.36ms
approx. 95 percentile: 1.01ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 7.7824/0.00
查看帮助