DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Implementing DDoS With MuleSoft: Demonstration With Apache JMeter
  • Monolithic Decomposition and Implementing Microservices Architecture
  • Organizing Knowledge With Knowledge Graphs: Industry Trends
  • Understanding the Power of Coefficient of Variation in Software Performance Testing

Trending

  • Docker Base Images Demystified: A Practical Guide
  • FIPS 140-3: The Security Standard That Protects Our Federal Data
  • Beyond Code Coverage: A Risk-Driven Revolution in Software Testing With Machine Learning
  • Unmasking Entity-Based Data Masking: Best Practices 2025
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Database Performance Testing With Apache JMeter

Database Performance Testing With Apache JMeter

Learn how to construct your database performance testing plan with all the most important elements, including a thread group, JDBC request, and summary report.

By 
Rathnadevi Manivannan user avatar
Rathnadevi Manivannan
·
Jul. 27, 17 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
37.4K Views

Join the DZone community and get the full member experience.

Join For Free

Database performance testing is used to identify performance issues before deploying database applications for end users. Database load testing is used to test the database applications for performance, reliability, and scalability using varying user load. Load testing involves simulating real-life user load for the target database applications and is used to determine the behavior of the database applications when multiple users hit the applications simultaneously.

Prerequisites

  • Install Java Development Kit.
  • Install Apache JMeter.

Use Case

Let's perform database load testing to measure the performance of a database using Apache JMeter by configuring MySQL JDBC driver.

Building Database Test Plan

A test plan describes a series of steps to be executed by JMeter on running a database test. To construct a test plan, the following elements are needed:

  • Thread group.
  • JDBC request.
  • Summary report.

Adding Users

The first step involved in creating a JMeter test plan is to add a thread group element. The element provides details about the number of users to be simulated, the frequency of requests to be sent by the users, and the number of requests to be sent by the users.

To add a thread group element, perform the following:

  • In the left pane, right-click Test Plan.
  • Select Add > Threads (Users) > Thread Group.
  • Provide the thread group name as JDBC Users.
  • Click Add to modify the default properties as:
    • No. of Threads (users): 10.
    • Ramp-Up Period (in seconds): 100.
    • Loop Count: 10, as shown in the below diagram:

thread_propertiesNote: The ramp-up period states the time taken to "ramp-up" to the full number of threads chosen. As 10 threads are used in our use case and the ramp-up period is 100 seconds, JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. The query will be executed for 10 (threads)*10 (loop) = 100 times. Likewise, for 10 tables, the total number of samples is 100.

Adding JDBC Requests

To add a JDBC request, perform the following:

  • In the left pane, right-click Thread Group.
  • Select Add > Config Element > JDBC Connection Configuration.
  • Configure the following details:
    • Variable Name: myDatabase 
      • Note: This name needs to be unique, as it is used by the JDBC Sampler to identify the configuration to be used.
    • Database URL: jdbc:mysql://ipOfTheServer:3306/cloud
    • JDBC Driver class: com.mysql.jdbc.Driver
    • Username: Username of the database.
    • Password: Password for the database username, as shown in the below diagram:

jdbc_connection_configuration

Adding Sampler

To add a sampler, perform the following:

  • In the left pane, right-click Thread Group.
  • Select Add > Sampler > JDBC Request.
  • Provide the following details:
    • Variable Name: myDatabase (same as in the configuration element).
    • Enter the SQL Query string field as shown in the below diagram:

jdbc_request

Adding Listener to View/Store Test Results

A listener is used to store test results of all JDBC requests in a file and present the results.

To view the test results, perform the following:

  • In the left pane, right-click Thread Group.
  • Select Add > Listener > View Results Tree/Summary Report/Graph Results.
  • Save the test plan and click Run (Start or Ctrl + R) to run the test.

All the test results will be stored in the Listener.

Viewing Test Results

We can look at tree view, table view, graph view, and response time graph view.

Tree View

The results can be viewed in tree format, as shown in the below diagram:view_results_tree

Table View

The results can be viewed in table format, as shown in the below diagram:table_view

Graph View

The results can be viewed in graph format, as shown in the below diagram:graph_view

Response Time Graph View

The results can be viewed in graph format, as shown in the below diagram:response_time_graph_view

And that's it! 

Database Apache JMeter Testing Test plan Load testing application Requests Diagram Use case Graph (Unix)

Published at DZone with permission of Rathnadevi Manivannan. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Implementing DDoS With MuleSoft: Demonstration With Apache JMeter
  • Monolithic Decomposition and Implementing Microservices Architecture
  • Organizing Knowledge With Knowledge Graphs: Industry Trends
  • Understanding the Power of Coefficient of Variation in Software Performance Testing

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!