CSV Data Set Config is the JMeter config element that takes one line of a CSV file per iteration and turns each column into a variable, so that every virtual user can log in with its own account, search for its own product or send its own order instead of repeating one hard-coded request. You add it with Add, Config Element, CSV Data Set Config, point the Filename field at the file, set the File encoding, give the variable names (or let the header line supply them), choose the delimiter and then decide three things that change the result of the test: whether the file starts again from the top when it runs out, whether a thread stops at the end of the file and which threads share one file pointer. In a sampler you use a column as ${username}. This guide is for performance engineers and QA teams who prepare test data for JMeter. It explains every field of the element, the four sharing modes, what happens at the end of the file, the mistakes that most often spoil a CSV-driven test and how the Random CSV Data Set Config plugin differs. Then it shows how to run the same CSV-driven test on PFLB Platform, strictly as the PFLB documentation describes it. We checked the facts on 22 November 2026 against the Apache JMeter component reference, the JMeter source, the plugin README and the PFLB documentation.
How to Add CSV Data Set Config to a JMeter Test Plan
A CSV file for JMeter holds one record per line and one value per column; a header line is optional. A small file for a login step, saved as users.csv next to the test plan, looks like this:
username,password,productId
alice01,Pa55-alice,1042
bob02,Pa55-bob,2210
carol03,Pa55-carol,3315
- Save the file. Keep it in the folder of the test plan, so that a relative path works, and keep the same folder layout wherever the test runs.
- Add the element. In the tree, open the context menu of the Thread Group (or of the Test Plan, if several thread groups use the file) and pick CSV Data Set Config under Add, Config Element. Where you put it decides its scope: like other config elements, it applies to the samplers in the part of the tree where it sits (Apache JMeter, scoping rules).
- Fill in the fields. For the file above: Filename
users.csv, File encodingUTF-8, Variable Names left empty so that JMeter takes the names from the header, Delimiter,. The next section explains each field. - Use the variables. In an HTTP Request, write
${username}and${password}in the body or the parameters, and/products/${productId}in the path. Each thread gets the values of one line per iteration. - Check with a few threads. Run the plan with three or four threads and a View Results Tree listener, look at the request bodies and make sure each thread sent different values. Remove the listener before the real load test.
According to the Apache JMeter manual, this element is simpler than the __CSVRead() and __StringFromFile() functions, and it suits tests that need many variables. It also advises you to create test data before the run: building unique random values while the test runs costs CPU and memory on the load generator (Apache JMeter component reference).
CSV Data Set Config Fields Explained
The field names below are the labels you see in the JMeter GUI (taken from the JMeter source), with what each one does according to the component reference.
| Field in the GUI | What it controls | Default and notes |
|---|---|---|
| Name | The label of the element in the test tree | Any text; useful when a plan has several CSV files |
| Filename | The CSV file to read | A relative path is resolved from the folder of the open test plan; absolute paths work too but usually break on remote servers |
| File encoding | The character set used to read the file | Platform default if empty; set UTF-8 explicitly when the data has non-ASCII characters |
| Variable Names (comma-delimited) | The names of the variables, in the order of the columns | Leave it empty and JMeter reads the first line of the file as the list of names |
| Ignore first line (only used if Variable Names is not empty) | Skips a header line when you typed the names yourself | Off by default; has no effect when Variable Names is empty, because then the first line is the header |
| Delimiter (use '\t' for tab) | The character that separates values in a line | , by default; type \t for a tab-separated file |
| Allow quoted data | Lets a value sit in double quotes, so it can contain the delimiter | Off by default; two double quotes inside a quoted value stand for one quote character |
| Recycle on EOF | Starts reading from the first line again when the file ends | True by default |
| Stop thread on EOF | Stops the thread at the end of the file when Recycle on EOF is false | False by default |
| Sharing mode | Which threads read from one shared file pointer | All threads by default; see below |
Two details from the reference are easy to miss. JMeter reads a new line at the start of each iteration of the thread, not once per sampler, so all samplers in one iteration see the same values. And the file name and sharing mode are resolved in the first iteration, so a file name built from a variable is not evaluated again later in the test.
Sharing Mode: All Threads, Current Thread Group, Current Thread or Identifier
Sharing mode decides how many readers a file has. The four options in the GUI:
- All threads (default). The file is opened once for the whole test. Each thread that starts a new iteration takes the next line, so two threads do not get the same line in the same pass through the file. The order in which threads take lines follows the order in which they run, which can change from one iteration to the next.
- Current thread group. The file is opened once per thread group that contains the element. Two thread groups each walk through the whole file.
- Current thread. Every thread opens the file on its own and reads it from the first line. With one shared file, this means every thread sends the same values in the same order, which is rarely what a load test needs. The mode is meant for a set of files, one per thread: name them
test1.csv,test2.csvand so on, use the filenametest${__threadNum}.csvand select Current thread, as the reference suggests. - Identifier. Type any text instead of choosing a mode. All threads that use the same text share one file pointer. With four thread groups, for example, two or more of them can share a file through a common identifier.
For unique logins, keep All threads and make sure the file has at least as many lines as the test will use. For data that every user may repeat, such as search terms, the default works too, and Recycle on EOF keeps the values coming.
What Happens at the End of the CSV File
When the last line has been read, the next iteration depends on two checkboxes:
| Recycle on EOF | Stop thread on EOF | What the thread does at the end of the file |
|---|---|---|
| True (default) | Ignored | Starts again from the first line; values repeat |
| False | False (default) | Keeps running, but every CSV variable now holds the text <EOF> |
| False | True | The thread stops |
The second row is behind many failed requests that look like application errors: the test keeps running, but the server receives a login called <EOF>. You can change that marker with the JMeter property csvdataset.eofstring, but in most tests the better fix is a file with enough lines or Stop thread on EOF switched on. If each line must be used exactly once, for example one registration per email address, set Recycle on EOF to false and Stop thread on EOF to true, so the test ends cleanly when the data runs out.
Common CSV Data Set Config Mistakes
Most of these follow directly from the component reference; the last two are our advice.
- The header line is sent as data. If you type the variable names and the file also has a header, the first iteration sends
usernameas a user name. Either leave Variable Names empty or tick Ignore first line. - The wrong delimiter. With a semicolon-separated file and the default comma, each line becomes one value. The reference notes that when a line has fewer values than there are variable names, the remaining variables are not updated and keep the value they had before, so the error can hide behind values from an earlier line.
- Commas inside values. Addresses and product names often contain the delimiter. Quote those values and tick Allow quoted data.
- One file under two paths.
users.csvand./users.csvare treated as two different files, each with its own pointer, so two elements that look the same can hand out the same lines twice. - Variables in elements that are read before the test. CSV variables are set at the start of each iteration, after the configuration has been processed. Elements that read their values at configuration time, such as JDBC Connection Configuration, cannot use them. Elements that read values while the test runs, such as the HTTP Authorization Manager, can.
- Current thread with a single file. As described above, every thread then reads the same lines. Use All threads or one file per thread.
- Too few lines for the test. Estimate the lines you need: threads multiplied by the iterations each thread runs. If the file is shorter and Recycle on EOF is on, logins repeat and the server may cache or lock them, which changes the result.
- Generating data during the run. Building random emails or IDs in JSR223 code for every request adds load to the generator that the real users would not add. Prepare the data in the file, as the manual recommends.
For other ways to feed data into a JMeter test, such as User Defined Variables and functions, see our full guide to JMeter parameterization.
Random Order with the Random CSV Data Set Config Plugin
The standard element reads the file from top to bottom. If the order of lines should be random, for example to spread searches across a catalogue, the BlazeMeter plugin bzm - Random CSV Data Set Config does that. It is listed in the JMeter Plugins Manager catalogue as Random CSV Data Set. According to the plugin README (Random CSV Data Set Config README), it has its own options:
- Random order. Takes records from the file in random order. Without this option the plugin works the same way as the standard element.
- Rewind on end of list. Starts a new pass when the list has been used up.
- First line is CSV header. Skips the header line, used when Variable Names is filled in.
- Independent list per thread. With Random order on, each thread gets its own randomly ordered copy of the values; with it off, all threads go through one shared random list.
The README also warns that the plugin reads the whole file when the test starts, which takes time and memory for large files. For a file with millions of lines, the standard element is the lighter choice.
CSV Files in a Distributed JMeter Test
In JMeter's own distributed mode, the controller does not send data files to the remote servers. The JMeter manual asks you to put each CSV file in the right directory on every server (Apache JMeter, remote testing). A relative Filename is then resolved against the directory where the JMeter server was started, and an absolute path only works if every server has the same directory structure.
The manual says that all the servers run the same test plan, and each of them reads its own copy of the file. If every login must be unique across the whole test, a shared file is not enough: the manual suggests giving each server different content, for example by dividing the IDs between the files. How to set up the servers themselves is covered on our distributed JMeter testing page.
Run the Same CSV-Driven Test on PFLB
If you would rather not copy CSV files to a set of load generators yourself, PFLB Platform offers two routes. They are described separately in the documentation, so we keep them separate here.
Route 1: import your JMX script with its CSV files. Click + New Test, then Import from JMeter, upload the JMX file (up to 100 MB) and the supporting files the script uses. The documentation lists the CSV parameters file among those files and says the paths inside the JMX can stay as they are (PFLB docs, supported plugins and elements; PFLB docs, import from JMX). What else the documentation says about CSV in imported scripts:
- CSV Data Set Config and bzm - Random CSV Data Set Config are on the list of supported config elements that the platform GUI does not let you edit. Re-upload in the container replaces the JMX script and its supporting files, so a CSV element is changed in JMeter and the script is uploaded again.
- Random CSV Data Set is on the list of supported plugins. A script with a plugin that is not on the list is not imported.
- The JMeter properties
csvdataset.eofstringandcsvdataset.file.encoding_listare on the list of supported JMeter properties.
Route 2: add a CSV parameter to a test built in the platform. For a test you create in the platform's editor, open the Parameters pane, click CSV file and upload a file with one or more columns, up to 50 MB (PFLB docs, add and use parameters). The import settings are:
- Field delimiter: a character or string such as
;. - The first line contains parameter's names. On: the first line gives the names. Off: you type the names yourself.
- Reuse values at the end of file. On: reading starts again from the top. Off: the documentation warns that the run can finish before its planned end once the file is used up.
- Separate values by threads. On: the load generator separates the data set, and each virtual user uses its own data set. Off: all virtual users use one common data set.
- Order. Random shuffles the lines before the test starts; Sequential reads them in order.
You then use a parameter as ${name} in the names of groups and transactions and in request URLs, and you can combine parameters, for example a literal parameter with the value ABC${i}DEF and a CSV column i. These settings belong to the platform's own CSV parameter. The documentation does not say that they map one to one to the JMeter sharing modes, so if you move a test from JMeter to the editor, check the behaviour with a short run first.
The results of a run are shown in the platform's Grafana dashboards (PFLB docs, visualizing tests in Grafana), and the platform can generate an AI report for a run (PFLB docs, reports).
The documentation does not describe how the lines of one CSV file are divided between several load generators or between copies of a container. If every line must be used exactly once across the whole test, plan the data for that and check it in a short run before the full load.
Which Route Fits
| CSV Data Set Config on your own JMeter machines | Imported JMX on PFLB Platform | CSV parameter in a PFLB test | |
|---|---|---|---|
| Where you set up the data | The element in JMeter | The element in JMeter; not edited in the platform | The CSV parameter dialog in the platform |
| Getting the file to the load generators | You copy it to every server | You upload it with the JMX; paths stay as they are | You upload it to the test, up to 50 MB |
| Random order | Random CSV Data Set Config plugin | The same plugin, supported | Order: Random |
| End of file | Recycle on EOF, Stop thread on EOF | As set in the JMX | Reuse values at the end of file |
| A good fit | A small test or a team with its own load infrastructure | A team with working JMeter scripts that wants to run them at scale | A team that builds tests in the platform's editor |
All three routes need the same thing first: a file with enough correct lines for the load you plan. Check it with a few threads before the full run.
If you want help with the test data behind a load test, such as how many unique users, which accounts and how to keep the data clean between runs, PFLB's performance engineers design the load model, prepare the data, write the scripts and run the tests with you.