jMeter - Best Practices

JMeter has some limitations especially when it is run in a distributed environment. Following these guidelines will assist in creating a real and continuous load −

  • Use multiple instances of JMeter in case, the number of threads are more.

  • Check the Scoping Rules and design accordingly.

  • Use naming conventions always for all elements.

  • Check the default browser Connectivity settings, before executing scripts.

  • Add Listeners appropriately.

  • Here are some suggestion to reduce resource requirements −

    • Use non-GUI mode: jmeter -n -t test.jmx -l test.jtl.

    • Use as few Listeners as possible; if using the -l flag as above, they can all be deleted or disabled.

    • Disable the “View Result Tree” listener as it consumes a lot of memory and can result in the console freezing or JMeter running out of memory. It is, however, safe to use the “View Result Tree” listener with only “Errors” checked.

    • Rather than using lots of similar samplers, use the same sampler in a loop, and use variables (CSV Data Set) to vary the sample. Or perhaps use the Access Log Sampler.

    • Do not use functional mode.

    • Use CSV output rather than XML.

    • Only save the data that you need.

    • Use as few Assertions as possible.

    • Disable all JMeter graphs as they consume a lot of memory. You can view all of the real time graphs using the JTLs tab in your web interface.

    • Do not forget to erase the local path from CSV Data Set Config if used.

    • Clean the Files tab prior to every test run.