Skip to main content
Back to blog
tutorials 5 September 2020 2 min read

JMeter & Redis

Learn how to integrate Apache JMeter with Redis for dynamic test data management, enabling you to modify datasets during live performance tests.

M

Mark

Performance Testing Expert

This technical guide explores how Apache JMeter integrates with Redis for enhanced test data management.

Overview

Traditionally, Apache JMeter manages test data through CSV files. However, the Redis Data Set plugin offers an alternative approach, enabling users to amend the data set used in a JMeter test plan while a test is in-flight.

What is Redis?

Redis is an in-memory data structure store, used as a database, cache and message broker. A key advantage is dynamic data modification during active testing.

Installation

JMeter Plugin

  1. Download plugins-manager.jar from jmeter-plugins.org
  2. Place in lib/ext directory
  3. Restart JMeter
  4. Access Options > Plugins Manager > Available Plugins
  5. Search for “Redis” and select “Redis Data Set”
  6. Apply changes and restart

Redis

Download and install from redis.io for your operating system.

Practical Implementation

First, create a Redis key containing your test data using LPUSH commands:

redis-cli LPUSH martkosit "Sheffield"
redis-cli LPUSH martkosit "Leeds"
redis-cli LPUSH martkosit "Cardiff"
redis-cli LPUSH martkosit "Manchester"
redis-cli LPUSH martkosit "London"

Configuration

In JMeter, configure the Redis Data Set:

  • Redis Key: martkosit
  • Variable Names: city
  • Redis server host: localhost

Using the Variable

The Dummy Sampler references the variable using ${city} syntax to retrieve values dynamically.

Dynamic Data Sets

The real power of this approach is adding new values while tests execute:

redis-cli LPUSH martkosit "New York"
redis-cli LPUSH martkosit "L.A"
redis-cli LPUSH martkosit "Boston"

New data is immediately accessible to running threads. This enables dynamic data sets to a live test and supports scenarios like extending datasets or removing problematic values.

Further Reading

Tags:

#jmeter #redis #performance-testing #test-data

Need help with performance testing?

Let's discuss how I can help improve your application's performance.

Get in Touch