How to perform load testing on Mysql Database using jmeter.

1. Mysql driver jar file for Jmeter: Download Mysql driver. Extract file 'com.mysql.jdbc_5.1.5.jar.zip' and put it to folder lib of JMETER.

2. Open Jmeter from : apache-jmeter_home/bin/jmeter.bat or ApacheJMeter.jar

3. Add Users

Select the Test Plan, right click on Test Plan, select Add> Threads(Users)> Thread Group
Set up the following fields for Users:
a. Set value for Numbers of Threads(users): 5
b. Set value for Ram-up Periods : 2.
It means that 5 users connect to MYSQL server withine 2 seconds.


4.Add JDBC Connection Configuration

Right click on the 'Thread Group', select Add > Config Element > JDBC Connection Configuration.
Set up the following fields for MySQL database:
a. Variable name bound to pool. This needs to uniquely identify the configuration. It is used by the JDBC Sampler to identify the configuration to be used. We have named it as 'dbconnectionpool'
b. Database URL: jdbc:mysql://IP:3306/databasename
c. JDBC Driver class: com.mysql.jdbc.Driver
d. Username: root
e. Password: password for root
f.The other fields can be left as the defaults


5. Add JDBC Requests

Right click on the 'Thread Group', select Add > Sampler > JDBC Request.
Then, select this new element to view its Control Panel. Edit the properties as below:
a. Enter the Pool Name: dbconnectionpool (same as in the configuration element)
b. Query Type: Select statement
c. Enter the SQL Query String field.


6. Adding a Listener to View/Store the Test Results

Right click on the 'Thread Group', select Add --> Listener --> View Results Tree and Summary Report
Save the test plan, and run the test with the menu Run --> Start or Ctrl+R

2 comments:

  1. Hello,
    The Article on How to perform load testing on Mysql Database using jmeter., gives detailed information about it. Thanks for Sharing the information about For More information check the detail on the load testing here Software Testing Company

    ReplyDelete