Use HammerDB to test standalone-deployed MySQL

Start HammerDB

Double-click the hammerdb file in the HammerDB installation directory.

Figure-1 HammerDB

 

Create the target database and account

[root@localhost ~]# mysql -uroot -p

Enter password:

mysql> create database tpcc;

Query OK, 1 row affected (0.02 sec)

 

mysql> grant all on tpcc.* to 'tpcc'@'%' identified by 'tpcc'; 

Query OK, 0 rows affected (0.06 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.02 sec)

Generate test data

  1. Double-click the MySQL node.

Figure-2 MySQL node

https://ask.qcloudimg.com/http-save/yehe-1408287/3b8iygvw1d.jpeg?imageView2/2/w/1620

 

  1. Select MySQL and TPC-C.

Figure-3 Selecting benchmark options

https://ask.qcloudimg.com/http-save/yehe-1408287/ya64hdm58t.png?imageView2/2/w/1620

 

  1. Select TPC-C > Schema Build, and then double-click Options.

Figure-4 Options

https://ask.qcloudimg.com/http-save/yehe-1408287/gd3bmsd37t.jpeg?imageView2/2/w/1620

 

  1. Configure the build options as shown in Figure-5.

Figure-5 Build options

 

  • Enter the IP address of the MySQL VM in the MySQL Host field.

  • Enter the name of the database to test in the MySQL Database field.

  • Create a MySQL account by setting the MySQL User and MySQL User Password parameters.

 

  1. Double-click the Build node.

Figure-6 Building a database

 

  1. View the output.

Make sure the status of each virtual user is not a red cross. A red cross indicates errors. When workers are finished, the monitoring thread will create indexes and storage procedure and collect statistics. The TPCC SCHEMA COMPLETE message will displayed for virtual user 1, and operations will be completed for the other virtual users. If not, check the error details in the area at the bottom and resolve problems.

 

Figure-7 Virtual user output

https://ask.qcloudimg.com/http-save/yehe-1408287/xeupumjr9o.jpeg?imageView2/2/w/1620

 

Figure-8 TPCC SCHEMA COMPLETE

https://ask.qcloudimg.com/http-save/yehe-1408287/acrkqy5gpg.jpeg?imageView2/2/w/1620

 

It takes about three to four hours to create 1000 warehouses.

Configure the HammerDB test script

  1. Click Destroy Virtual Users.

Figure-9 Destroying virtual users

https://ask.qcloudimg.com/http-save/yehe-1408287/8ivn2bdxp6.jpeg?imageView2/2/w/1620

 

  1. Double-click the Driver Script node.

Figure-10 Driver Script node

 

  1. Select Timed Test Driver Script, and set the rampup time to 2 minutes and test duration to 5 minutes.

Figure-11 Configuring the timed test driver script

 

  1. Double-click the Load node under the Driver Script node.

Figure-12 Loading the script

 

Run the HammerDB test

  1. Double-click the Options node under the Virtual User node and enter the number of virtual users.

You need to create a master user who collects statistics and returned states of virtual users. The master user is not included in the virtual users to create. For example, if you want to create 16 virtual users (16 concurrent connections), create 17 virtual users.

 

Figure-13 Creating virtual users

 

Performance data is the best if the number of virtual users is the number of CPU cores plus 1. For example, if the CPU has 16 cores, create 17 virtual users.

  1. Double-click the Create node under the Virtual User node.

The database is not connected now.

Figure-14 Creating virtual users

 

  1. Double-click the Run node under the Virtual User node. Click the  icon to view the TPM value.

Figure-15 Running the test

 

  1. View the line chart for performance jitters.

Figure-16 Line chart

 

  1. View the virtual user output for the test result.

Figure-17 Test result