sysbench是一款测试工具

主要包括以下几种方式的测试:

     1、cpu性能

     2、磁盘io性能

    3、调度程式性能

     4、内存分配及传输速度

     5、POSIX线程性能

     6、数据库性能(OLTP基准测试)现在sysbench主要支持 MySQL,pgsql,oracle 这3种数据库

安装

Debian/Ubuntu安装:

sudo apt-get install sysbench

CentOS/Fedora安装:

sudo yum install sysbench

如果提示“No match for argument: sysbench”,先执行:

yum -y install epel-release

然后在执行安装即可。


测试例子:

sysbench cpu --cpu-max-prime=20000 --threads=2 run

返回结果:

sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 2
Initializing random number generator from current time


Prime numbers limit: 20000

Initializing worker threads...

Threads started!

CPU speed:
    events per second:   734.77

General statistics:
    total time:                          10.0015s
    total number of events:              7350

Latency (ms):
         min:                                    2.62
         avg:                                    2.72
         max:                                   35.68
         95th percentile:                        2.76
         sum:                                19993.60

Threads fairness:
    events (avg/stddev):           3675.0000/0.00
    execution time (avg/stddev):   9.9968/0.00