How to Split or Distribute CSV Files in Performance Tests

Depending on your Performance test scenario, you may want to run a multi-engines test with a single CSV file, or set up a separate CSV file for each JMeter engine.


Run a Multi-Engines Test With a Single CSV File

If your test runs across multiple engines, you likely do not want two engines to use the same row of data. For example, you don't want to execute the registration test for the same test user twice. If you wish to run a multi-engine test with a single CSV file for all engines without using duplicate values, let BlazeMeter split the CSV file.

To split your CSV data into unique subsets for each engine, select the Split CSV files with a unique subset per engine checkbox in the Scenario Definition.

For example: You run a 1000-concurrent-users test, on 5 engines. You have uploaded a CSV file containing 1000 unique user names to simulate a registration scenario. Enable the 'Split CSV files' checkbox, and when the test is initiating, the CSV file will be split 5 ways and each unique subset will be directed to a different engine. Line one will go to engine one, line two to engine two, line six again to engine one, line seven to engine two, and so on.

Note that Split CSV Files will not preserve the CSV header across engines. A best practice is to always omit the header row in the CSV file and to declare variable names in the CSV Data Set Config instead. This ensures that you can always find where variables are set by searching your JMX files.



Run a 'Multi Test' Simultaneously With a Single CSV File

A Multi Test is a feature which enables you to run several tests simultaneously. For more information regarding the Multi Test, see Creating a Multi-Test.

If you wish to use one CSV Data Set Config for the entire Multi Test (unique data sets per engine, per test) then click Data Files and upload the CSV file when prompted. You will then be presented with a choice whether to split the CSV or not.


How to Set up a Separate CSV File for Each JMeter Engine

If you want to use multiple JMeter engines with a different CSV file per JMeter engine, upload a different file for each JMeter engine and point to a variable to differentiate between each file.

Each JMeter engine uses a distinct variable TAURUS_SESSIONS_INDEX. The values for this variable start from 1 for the JMeter engines.

Each JMeter engine uses a distinct parameter ${__P(InstanceID)}. The InstanceID values start from 1 for JMeter engines.

Example Scenario

In this scenario, you are using two JMeter engines. You upload two test data files named file1.csv and file2.csv.

Taurus Example

In the Taurus script's CSV Filename field, you specify: file${__env(TAURUS_SESSIONS_INDEX)}.csv.

Now, the first JMeter engine will read file1.csv. The second will read file2.csv. And so on.

JMX Example

In the JMX script's CSV Data Set Config section, enter the following in the CSV Filename field:

This way, the first JMeter engine will read file1.csv. The second will read file2.csv. And so on.