Load Testing Your LDAP With JMeter Part 2

Welcome to part 2 of our two part series on load testing your LDAP with JMeter. In part 1, we setup a simple test plan with a thread group and loop controller along with a simple LDAP Request sampler.

Today in part 2, we will look at using a CSV file to drive a multithreaded test with different users. We will also demonstrate how you can distribute your load test across multiple machines to enhance the capabilities.


Using a CSV File

To start, setup a simple CSV file with each line containing a username and password, like this:



And so on.  You can also add any number of comma-delimited fields to this file, if desired, but we’ll keep it simple for now.

Next, back in JMeter, we will continue with our sample test plan from part 1. Right click on the Loop Controller and select Add -> Config Element -> CSV Data Set Config.

The location of the CSV Data Set Config element in the test plan does not matter. As long as it is a child of the Thread Group, the data in the file will be available.


Configure CSV Data Set

To setup the CSV Data Set Config, select the element in the test plan and enter a filename and variable names as seen below. Note that you can also choose the “Recycle on EOF” option to allow the records to be reused even if the EOF is reached.


Next, update the LDAP Extended Request to use the variable names from the CSV Data Set. Update the Username param to include ${username} in your DN. Next, do the same with the password field: ${password}. Note that the password will still be masked even though you are entering a variable expression in the field. Even though it isn’t obvious, it will still use the value from the CSV file for the bind password.

Finally, go back to your Thread Group and set the Number of Threads to a value at least as high as the number of rows in your CSV. The result is that each new thread will use the next row in the CSV for its parameters. If EOF is reached, it will recycle the records up until the thread count is reached.


Distributing Your Load Test

 JMeter makes it incredibly easy to distribute your load test across several machines. To start, identify one or more remote machines (it is easiest if they are all on the same submit) to use for the test.

Next, make sure you have the same version of JMeter on all of your remote hosts. If your remote host is Windows, you’ll need to update the jmeter-server.bat file (find the START rmiregistry line and update it to include the full path to rmiregistry. Then simply start the jmeter-server by running jmeter-server or jmeter-server.bat (depending on your OS).

Finally, open the jmeter.properties file on your master machine and update the comma-delimited list of remote_hosts (around line 158). Then simply run JMeter and load your test plan. When you’re ready, click Remote Start all. You will see “Starting the test…” in the log on your remote hosts.


Questions, comments or concerns? Feel free to reach out to us below, or email us at IDMWORKS to learn more about how you can protect your organization and customers.