Distributed Load Testing in Apache JMeter
Distributed Load Testing in Apache JMeter
1. Run Tests in Non-GUI Mode: Running JMeter using command line in non-GUI mode is very
simple. Keep .JMX file in jmeter bin folder.
A. Open command prompt
B. Go into JMeter’s bin folder
C. Enter following command, jmeter -n –t test.jmx -l testresults.jtl
(use jmeter -n -t test.jmx test.jtl, add a '-l' argument before the test plan name for
listeners.)
View test result: After completing the test, a JTL file will be generated at jmeter/bin folder
A. Open JMeter in GUI mode.
B. Add any listener Eg. View Results Tree.
C. Click Browse button of the file name field in listener.
D. Open testresult.jtl file. (You should be able to see the result in listener now.)
2. Increase the maximum heap size to ~80% of your total available physical RAM.
3. Use Remote and Distributed testing for larger load testing
4. Do not load more than 300 threads per Jmeter engine
5. Do not add Listeners to your Jmeter test plan (Disable ALL Listeners During the Test Run)
6. Do not add Graphs to your Jmeter test plan
7. Monitor the command prompt of Jmeter during testing (non-GUI mode) Monitor the log during
testing (GUI mode)
8. Erase the local path of all the CSV Data Set config files
9. Use naming conventions for all the elements
10. Use JTL file name (XML format) to store the logs
11. Add following properties for better output in jmeter.properties file.
jmeter.save.saveservice.output_format=csv jmeter.save.saveservice.data_type=false
jmeter.save.saveservice.label=true jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_data.on_error=false
jmeter.save.saveservice.response_message=false jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=false jmeter.save.saveservice.assertions=false
jmeter.save.saveservice.latency=true jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.hostname=true jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.sample_count=true
jmeter.save.saveservice.assertion_results_failure_message=false
jmeter.save.saveservice.timestamp_format=HH:mm:ss
jmeter.save.saveservice.default_delimiter=; jmeter.save.saveservice.print_field_names=true
12. relevant Assertions and Post-processors elements only
13. Do not use XPATH extractor
14. SR 223 and Groovy for scripting
15. Generate reports after run
16. Use Up-to-Date Software :
pg. 1
17. Your test might fail if your software is out of date. Make sure you’re using the most recent
versions of the following:
Java: use the latest 64-bit version of Java SE JDK or Server JRE where possible
JMeter: it’s always best to use the latest version of JMeter as the new releases contain performance improvements and bug fixes in
addition to any new features.
Client
Server
pg. 2
Distributed setup prerequisite
1. All firewalls in JMeter master and slave machines should be turned off
2. All machines should be in same subnet
3. Use same version of JMeter in all machines (Master and Slaves)
pg. 3
Starting the Distributed test
Start jmeter.bat in master machine and open the test plan to run. Use remote start or
remote start all option from the menu. Alternatively, you can use command prompt to
run the test script as shown below.
Note: If you want load 1000 users on 5 systems (server / slave), then run for 200
users on Master or Client.
Troubleshooting
If you are unable to run test form the above machine and see below error, simply ask
owner of slave machine to run the jmeter-server.bat File.
pg. 4
Limitation:
There are some basic limitations for distributed testing. Here's list of the known
items:
pg. 5