sysbench是一个模块化的、跨平台、多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况。它主要包括以下几种方式的测试: 1、cpu性能 2、磁盘io性能 3、调度程序性能 4、内存分配及传输速度 5、POSIX线程性能 6、数据库性能(OLTP基准测试) 目前sysbench主要支持 MySQL,pgsql,oracle 这3种数据库。 一、安装
tar zxf sysbench-0.4.8.tar.gzcd sysbench-0.4.8./configure &&
make && make installstrip /usr/local/bin/sysbench
/configure --with-mysql-includes=/usr/local/mysql/include
--with-mysql-libs=/usr/local/mysql/lib && make && make
install 二、开始测试 sysbench --test=cpu --cpu-max-prime=20000 run 2、线程测试 sysbench --test=threads --num-threads=64 --thread-yields=100 --thread-locks=2 run
sysbench --test=fileio --num-threads=16 --file-total-size=3G
--file-test-mode=rndrw preparesysbench --test=fileio --num-threads=16
--file-total-size=3G --file-test-mode=rndrw runsysbench --test=fileio
--num-threads=16 --file-total-size=3G --file-test-mode=rndrw cleanup 4、内存测试 sysbench --test=memory --memory-block-size=8k --memory-total-size=4G run 5、OLTP测试
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 |