Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Database Testing with JMeter

Database Testing with JMeter

Most of the applications’ performance can be tested by triggering HTTP, FTP or some other protocols.

There are some cases where we want to directly test the database system without interfering the HTTP calls.

Apache JMeter has a built-in JDBC Request module.

Let’s see how we can do database testing with Jmeter!

Loadium

June 12, 2018
Tweet

More Decks by Loadium

Other Decks in Technology

Transcript

  1. Database Testing with JMeter • Most of the applications’ performance

    can be tested by triggering HTTP, FTP or some other protocols. • There are some cases where we want to directly test the database system without interfering the HTTP calls. • Apache JMeter has a built-in JDBC Request module. • Let’s see how we can do database testing with Jmeter! – JMeter can connect to any database and run SQL queries concurrently. In order to do so, it’s mandatory to have necessary JDBC drivers in the lib folder of your installation. – Most important part of the Database performance testing is to have valid connection strings in JDBC Connection Configuration.
  2. JDBC Connection Configuration • Add a JDBC Connection Configuration by

    using Add-> Config Element menu. There are some fields that should be filled out.
  3. JDBC Connection Configuration • Variable Name: This value will be

    used in our JDBC Sampler. In case there is more than one SQL connection, JDBC request will use the right DB Connection by using this value. • Connection Pool Configuration: Leave it as it is. These values are good enough for a performance test. In case it’s needed, increasing or decreasing the values is a possibility. • Database URL: It’s obvious isn’t it? • JDBC Driver Class: It’s different for every Database vendor – Mysql uses com.mysql.jdbc.Driver – Oracle uses oracle.jdbc.driver.OracleDriver – Microsoft uses com.microsoft.sqlserver.jdbc.SQLServerDriver
  4. • Username & Password: Another obvious configuration, isn’t it? •

    Lastly, add a JDBC Sampler using Add->Sampler menu. Just fill out the Variable Name property you defined in the configuration. It must be exactly the same. Every request should be bound to a JDBC Configuration. If it’s not, the statement will not be executed by JMeter. JDBC Connection Configuration
  5. Ready Set Go! • Now you are ready to go!

    Just run your JMeter plan and execute performance test into your database directly. Happy Load Testing!