Using Sysbench for cloud database MySQL testing
I'm using a kingsoft.
1. Cloud Server Setup Instance ip:x.x.x.x centos-7.2 will have server account, server password
2. Cloud Database Establishment Instance (relational database RDS) IP:Y.Y.Y.Y will have a database account, the database password should be noted that the cloud host and cloud database routing or VPC is the same
3. Remote connection to cloud host IP using SECURECRT: Server account, server password
4. After the connection is successful, enter the SECURECRT and start installing the MySQL service (reference: http://blog.csdn.net/wshdc0802/article/details/78077963)
# Rpm-qa |grep-i mysql See if MySQL
is installed
# rpm-e php-mysql Delete old version
# rpm-e Pcp-pmda-mysql Delete old version
# rpm-e--nodeps pcp-pmda-mysql Brute force Delete old version
# wget http://repo.mysql.com/mysql-community-release-el7.rpm Download Database
# RPM-IVH mysql-community-release-el7.rpm Execute RPM-IVH RPM package name
# Yum install mysql-server yum MySQL dependency pack
I'll enter y below.
5. Connect MySQL remotely on a cloud host
# mysql-h y.y.y.y-u with user name-p password
6. Successful connection will occur
Quit MySQL
Input #quit
7.yum installation Sysbench, very convenient
# yum Install-y sysbench
The installation was successfully entered #sysbench will show the version my version is 1.0.6
8. Test the cloud Database with Sysbench MySQL (OLTP test)
The 1.0.6 version dropped the--test=
For MySQL OLTP testing, there are three stages that need to go through prepare,run,cleanup. The prepare stage produces a table of the specified number of rows in the database, with the default table under the Sbtest schema, with the table name
Sbtest (Sysbench The default build table for the storage engine is InnoDB)
Prepare: The data preparation phase for file IO and database OLTP testing.
Run: Performance test phase
Cleanup: Removing data generated during a test
First build the database sbtest in MySQL and then execute the command.
Prepare
Sysbench/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua--db-driver=mysql--threads= --time= 7200 --max-requests=0 --oltp-read-only=off--report-interval= --oltp-table-size= --oltp-tables-count=--mysql-table-engine=innodb --mysql-host=172.31. 252.149 --mysql-port=3306 --mysql-user=admin--mysql-password=tan123yong456 Prepare
Run
Sysbench/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua--db-driver=mysql--threads= --time= --max-requests=0 --oltp-read-only=off--report-interval=--oltp-table-size= --oltp-tables-count=--mysql-table-engine=innodb --mysql-host=172.31. 252.149 --mysql-port=3306 --mysql-user=admin--mysql-password=tan123yong456 Run
Cleanup
Sysbench/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua--db-driver=mysql--threads= --time= --max-requests=0 --oltp-read-only=off--report-interval=--oltp-table-size= --oltp-tables-count=--mysql-table-engine=innodb --mysql-host=172.31. 252.149 --mysql-port=3306 --mysql-user=admin--mysql-password=tan123yong456 cleanup
Find the location of Oltp.lua using # Find/-name Oltp.lua/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua
--db-driver=mysql Specifying the database driver
--threads=32创建测试线程的数目
--time=60 Maximum execution time, unit is s
--max-requests The default value is 10000, if you set the –max-requests or use the default value, the main view when analyzing the results of the run time In general, –max-requests is assigned a value of 0, which means no limit on the number of requests,--time to specify the length of the test, and then the number of transactions per second of the system.
--oltp-read-only=off 表示不要进行只读测试,也就是会采用读写混合模式测试
--REPORT-INTERVAL=10 indicates a test progress report is output every 10 seconds
--oltp-table-size=1000 Insert 1000 data per table
--OLTP-TABLES-COUNT=32 Total 32 Tables created
--mysql-table-engine=innodb data table storage Engine is InnoDB
--mysql-host=172.31.252.149--mysql-port=3306--mysql-user=admin--mysql-password=tan123yong456 Database host number, port number, user name, Password
Testing of Cloud Databases