Reader small image

You're reading from  Master Apache JMeter - From Load Testing to DevOps

Product typeBook
Published inAug 2019
Reading LevelBeginner
Publisher
ISBN-139781839217647
Edition1st Edition
Languages
Right arrow
Authors (3):
Antonio Gomes Rodrigues
Antonio Gomes Rodrigues
author image
Antonio Gomes Rodrigues

Antonio Gomes Rodrigues has been an expert in the field of application performance for more than 10 years. Antonio has significant experience working with load testing tools like JMeter and LoadRunner. He is currently a committer and a PMC member of the JMeter project within the Apache Software Foundation.
Read more about Antonio Gomes Rodrigues

Bruno Demion (Milamber)
Bruno Demion (Milamber)
author image
Bruno Demion (Milamber)

Bruno Demion, better known as Milamber, is a French computer scientist. Since December 2003, he has been working with JMeter to perform load tests in various missions and training courses. He contributes to the JMeter project, in particular on the translation into French of the graphical interface, corrections of anomalies as well as some behaviors (proxy HTTPS, new results tree, icon bar, and so on). He is currently a committer, PMC member and the PMC Chair of the Apache JMeter project within the Apache Software Foundation.
Read more about Bruno Demion (Milamber)

Philippe Mouawad
Philippe Mouawad
author image
Philippe Mouawad

Philippe Mouawad is a technical expert and architect in J2E and web environments in the company Ubik-Ingenierie. He has been using JMeter since 2009. He contributes to the JMeter-Plugins (Redis DataSet, Graphs Generator Listener, and various patches) project. He is currently a committer and a PMC member of the JMeter project within the Apache Software Foundation. He is also a lead developer of the Ubik Load Pack solution.
Read more about Philippe Mouawad

View More author details
Right arrow

Load Testing a Database Server

Microservices architectures are increasingly being used, which involves more and more databases being used as well.

Usually, databases are accessed through an API, and therefore, for a load test to be as realistic as possible, it is necessary to test the API, and not the database directly:

Figure 9.1: Microservices architecture versus monolithic architecture

However, it may be useful to test the database directly when:

  • The API is not yet ready
  • To compare JDBC drivers easily
  • To tune database parameters
  • To compare different databases
  • To compare AWS RDS engine implementations (such as Aurora, Oracle, and SQL Server)
  • To check the database configuration
  • To check whether the cluster (as in, the VIP and load balancing strategy) is behaving well
  • To test the database production server before going live without having an API server production-ready
  • To do load testing on a database when a batch is...

Putting Theory into Practice with JMeter

Let's move on to practice.

Example 1: Load Test of a Database

Let's start with a simple example (which we will enrich as we go along) that consists of testing a database under MySQL using a SQL query.

In this example, we will use the Employees database available at https://github.com/datacharmer/test_db.

Let's first deal with SQL queries of the SELECT type:

  1. Let's start by configuring our connection to MySQL using the JDBC Connection Configuration item.

    For MySQL, the database URL must be in the form of jdbc:mysql://host:port/dbname and the JDBC driver class must be com.mysql.jdbc.Driver.

    In our case, the MySQL database is installed locally on the same machine as JMeter (avoid this absolutely during real tests). Its URL will be jdbc:mysql://localhost:3306/employees:

    Note

    If not already the case, set the maximum number of connections (Max Number of Connections) to zero so that each thread has its own connection.

    Figure 9.7: JDBC connection...
You have been reading a chapter from
Master Apache JMeter - From Load Testing to DevOps
Published in: Aug 2019Publisher: ISBN-13: 9781839217647
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Authors (3)

author image
Antonio Gomes Rodrigues

Antonio Gomes Rodrigues has been an expert in the field of application performance for more than 10 years. Antonio has significant experience working with load testing tools like JMeter and LoadRunner. He is currently a committer and a PMC member of the JMeter project within the Apache Software Foundation.
Read more about Antonio Gomes Rodrigues

author image
Bruno Demion (Milamber)

Bruno Demion, better known as Milamber, is a French computer scientist. Since December 2003, he has been working with JMeter to perform load tests in various missions and training courses. He contributes to the JMeter project, in particular on the translation into French of the graphical interface, corrections of anomalies as well as some behaviors (proxy HTTPS, new results tree, icon bar, and so on). He is currently a committer, PMC member and the PMC Chair of the Apache JMeter project within the Apache Software Foundation.
Read more about Bruno Demion (Milamber)

author image
Philippe Mouawad

Philippe Mouawad is a technical expert and architect in J2E and web environments in the company Ubik-Ingenierie. He has been using JMeter since 2009. He contributes to the JMeter-Plugins (Redis DataSet, Graphs Generator Listener, and various patches) project. He is currently a committer and a PMC member of the JMeter project within the Apache Software Foundation. He is also a lead developer of the Ubik Load Pack solution.
Read more about Philippe Mouawad