Quantcast
Channel: CodeSection,代码区,数据库(综合) - CodeSec
Viewing all articles
Browse latest Browse all 6262

JMeter CSV Data Set Config vs Redis Data Set Config Throughput Comparison

$
0
0

In this post, I would like to show you how to use Redis Data Set Config and how it affects the throughput of your test.

Redis:

Redis stands for RE mote DI ctionary S erver. It is an open source in-memory data structure store database. It stores various data structures like String, Map, Lists, Sets etc as Key value pairs. As it is an in-memory database, It keepsall the data in the RAM (it can also write the data in the disk). So you get significant amount of performance boost while reading/writingthe data.

Goal:

My goal here is to see how redis can be used with JMeter to keep my test data instead of a CSV file and to understand the kind of impact I will have in my test when Iuse Redis instead of CSV!

Why Redis:

Most of use would like to keep the JMeter test data in the CSV file. Even though CSV file is a very good choice here, It becomes very difficult to manage when you use JMeter in distributed mode. As you probably know, JMeter simply executes the same jmx file in the all the slaves. So, CSV file, which is dependency for your JMeter test, should also be copied to all the slaves yourself. Sometimes, the test data used by slave1 should not be used by slave2. In this case, you need split the CSV file into multiple files and move to slave machines accordingly. Redis might also have some limitations like the data it can store depends on the memory we allocate, performance degrade due to memory fragmentation issues etc.

CSV Data Set config: First I create a very simple CSV file with 100,000 records.
JMeter   CSV Data Set Config vs Redis Data Set Config   Throughput Comparison
I create a simple JMeter test to read the CSV file as shown in this picture.
JMeter   CSV Data Set Config vs Redis Data Set Config   Throughput Comparison
Now simply run this test in non-gui mode.
JMeter   CSV Data Set Config vs Redis Data Set Config   Throughput Comparison
OMG!! JMeter with CSV data set config can read 100K records in a second. RedisData Set config:

Now Lets do a similar test using Redis Data Set Config.

First ensure that you have ‘Redis Data Set Config’ plugin installed. At this time of writing this post, JMeter Plugin Manager does not install Redis plugin correctly. The Redis jar is missing a property file. Use this link & use the extras set to download the working version of Redis Data Set Config. Ensure that You have Redis is installed and are able to access it. Check here for installation. Lets create those 100,000 records in Redis as we did for CSV.
JMeter   CSV Data Set Config vs Redis Data Set Config   Throughput Comparison
I create a very simple test to use Redis Data Set Config instead of CSV. Everything else remains unchanged.
JMeter   CSV Data Set Config vs Redis Data Set Config   Throughput Comparison
Run the test in non-gui mode.
JMeter   CSV Data Set Config vs Redis Data Set Config   Throughput Comparison
This is not really bad. 2300 records in a second is good. Summary:

I expected this result because CSV file is going to be in your local and Redis DB is somewhere in your network. So CSV file read will perform better than Redis. However CSV read performs 40X better than Redis which is surprising. I am trying to share this information with you all so that you can be very careful when you create a JMeter test to test a very high throughput application. As I have been saying always we all needto be careful what kind of elements we add to the test.

You might be interested in reading few similar posts.

Post Processors / Script Language Comparison Response Data Extractors Comparison

Happy Testing


Viewing all articles
Browse latest Browse all 6262

Trending Articles