1. Download sysbench-0.5.tar.gz
the Sysbench source code can be Https://launchpad.net/sysbench found
This directory will be used multiple times in subsequent sysbench installations. If MySQL is not installed in the default directory, please replace it in the next steps.
First RPM mode installation mysql-5.6.28
Sysbench requires autoconf, Automake, and libtool packages if they do not exist and need to be installed first.
Yum-y Install Libtool automake autoconf
Execute the following command to install sysbench-0.5:
Tar xzvf sysbench-0.5.tar.gz
CD sysbench-0.5
chmod +x autogen.sh
./autogen.sh
./configure--with-mysql--with-mysql-includes=/usr/include/mysql/--with-mysql-libs=/usr/lib (RPM installation mode use)
Make
Make install
2. Common list of parameters
--mysql-host=10.10.38.172 #数据库host
--mysql-port=3306 #数据库端口
--mysql-user=your_username #数据库用户名
--mysql-password=your_password #数据库密码
--mysql-db=your_db_for_test #数据库名
--oltp-tables-count=10 #模拟的表的个数, the higher the size, the greater the value
--oltp-table-size=6000000 #模拟的每张表的行数, the higher the size, the greater the value
--num-threads=50 #模拟的并发数量, the higher the size, the greater the value
--max-requests=100000000 #最大请求次数
--max-time=20 #最大测试时间 (with--max-requests as long as there is one over, then exit)
--report-interval=1 #每1秒打印一次当前的QPS等值
--test=/tmp/sysbench-0.5/sysbench/tests/db/oltp.lua #选用的测试脚本 (LUA), this script can be found from the sysbench-0.5 source code file directory [Prepare | run | Cleanup] #prepare准备数据, run executes the test, cleanup cleans up the data
3. Preparing data
[Email protected] sysbench-0.5]# sysbench--mysql-host=10.10.38.172--mysql-port=3307--mysql-user=test-- Mysql-password=test--mysql-db=test--oltp-tables-count=10--oltp-table-size=6000000--num-threads=50-- max-requests=100000000--report-interval=1--test=/data/software/sysbench-0.5/sysbench/tests/db/oltp.lua Prepare
650) this.width=650; "title=" QQ picture 20160316112031.png "Src=" http://s3.51cto.com/wyfs02/M00/7D/72/ Wkiol1bo0e6qztyyaaftxxnwhic473.png "alt=" Wkiol1bo0e6qztyyaaftxxnwhic473.png "/>
Transmission of 4G content, 8k per block, speed approx. 3964M per second
Disk IO Test
Sysbench--test=fileio--num-threads=16--file-total-size=3g--FILE-TEST-MODE=RNDRW Prepare
Sysbench--test=fileio--num-threads=16--file-total-size=3g--FILE-TEST-MODE=RNDRW Run
Specifies a maximum of 16 threads created, the total document size is 3G, the document read/write mode is random read, and the disk random read/write speed is approximately 65m/s
CPU Test sysbench--test=cpu--num-threads=32--cpu-max-prime=90000 Run
32 threads, looking for the maximum prime number within 90000 to spend 76s
PS Hardware condition Dell Virtual machine: 4C 8G
Database type: MySQL5.6.28 maximum number of connections: default
This article is from the "Centos-web Server Deployment" blog, so be sure to keep this source http://laomeng.blog.51cto.com/6170639/1751698
Sysbench to mysql-5.6.28 Test