JMeter Best Practices and Troubleshooting
This topic describes best practices and limitations when working with JMeter, and how to troubleshoot issues that may occur.
Generally, JMeter supports shutting down gracefully. This requires appropriate port configuration, and to set the Run until completion option.
If there is a timeout by Controller, JMeter will receive the shutdown gracefully command and stay there for 2 minutes.
Click Stop Now in the Run tab if you want to stop the scenario aggressively.
The following are recommended as best practices when working with JMeter tests:
When running JMeter tests, it is recommended that you use dedicated load generator machines. Running tests from the Controller, using the localhost load generator, may cause some instability.
It is recommended that you use scenario mode (Vuser group mode) when running JMeter scripts. If you do use percentage mode, note how many instances of the JMeter test you will be executing.
Before running LoadRunner scenarios, check that your JMeter test can run with the JMeter installation on the load generator.
Run a maximum of one .jmx test (using 1 Vuser - default value) per each load generator. If the .jmx test is running a lot of threads, more than one test may overload the system.
Let the scripts run to completion.
Note the following when working with JMeter in LoadRunner:
- Network Virtualization is not supported for JMeter tests.
- If using percentage mode for a JMeter scenario, note that only one load generator can be assigned from the list.
Troubleshooting JMeter tests
If you have any difficulty running JMeter tests, check if the following can resolve the issue.
Error: Cannot find the JMX file 'C:\jmeter_tests\test.jmx‘.
The file is not present in this location.
Not enough disk space to clone the file.
Error: The JMETER_HOME environment variable is not configured.
Resolution: Define the JMETER_HOME environment variable, or add the JMeter path in Runtime Settings.
Error pattern: Message contains “Problem loading XML from: ‘……’ missing class ….
Resolution: The JMeter test may contain 3rd-party plugins, and the plugins are missing in the currently used JMeter instance. Either remove the plugins from the JMeter test file, or add the plugins to the JMeter instance.
Error: Unable to bind to free port (for Shutdown/StopTestNow) in range 4445 - 4455. Please extend the port range in the JMeter Runtime Settings.
Resolution: In Runtime Settings, extend the JMeter port range, or change to default.
There is no data in JMeter graphs in Controller or Analysis.
Resolution: In Runtime Settings, make sure that the Start measurement check box is selected.
Errors: Failed to create a Java virtual machine (JVM); Failed to load the 'jvm.dll/libjvm.so’ library file.
Resolution: Check that Java is properly installed on the machine.
For Windows: Check that the folder that contains jvm.dll is included.
For Linux: Check that LD_LIBRARY_PATH includes directory of libjvm.so.