You require to do Load test that requires thousands of thread. How will you configure JMeter so that JMeter performs well without any issues? Issues that you normally encounter with JMeter when using large number of threads are
- Out of Memory error
- High CPU usage
- High Memory usage
- JMeter scripts not responding or not ending
If you have faced above problems or require to perform load test with higher number of threads( 100 or more) you are at the right place. This article will help you get most out of JMeter.
JMeter tuning tips
Listeners consume more resources.
Listeners receive Sample Results and do some processing with it, this takes resources (memory, CPU). REMOVE ALL Listeners from your script once you are ready to load test. Listeners should be used only while creating and debugging your scripts. You can view your results after your execution is complete. The result file is saved using -l option in non GUI mode. The next recommendation is in using Non-GUI mode.
Use Non-GUI mode
GUI mode is for creating the test plan, checking it, debugging it. Once you are ready with the script, remove all listeners as mentioned above and run in Non-GUI mode . The command for the same is as follows:
jmeter –t <path of .jmx file> -n -l <Path for jtl file name name>
Configure JMeter java options
Default heap size is 512 Mb. Increase it to 1024 or more. On how to configure Heap Size refer the following Post
Use CSV output rather than xml
CSV is less CPU and memory intensive. To use CSV output update user.properties, as shown below
Do not use functional mode for load testing
Save data that you need.
Use few assertions and Post-Processors
Always use latest version of JMeter
Use distributed mode for very high load.
Once you reach the limits of one machine, you can switch to distributed or remote testing. When using distributed load testing make sure to update mode properties correctly. In user.properties file update
To know more on distributed testing click here.
If the above points are not enough and you still face issue contact me details.