• info@helpingtesters.com
  • helpingtesters

JMeter Best Practices

September 10, 2017 JMeter Tutorial

JMeter is a popular tool and is being used on a very high level to do performance testing. It helps to find out response time, Average time, load that application can withstand etc. Knowing the tool is one thing but using it efficiently is another. In this blog, we will be discussing JMeter best Practices that one should follow while using JMeter. 

→Complete list of JMeter Tutorial Series

⇒ Use Latest version of JMeter – JMeter best Practices

  • JMeter is being constantly developed. It has grown exponentially since the earliest versions and it is still growing. Every new version is an improved version as per the previous one.
  • It is highly recommended that in order to utilize the enhancements one must work with latest versions.
  • Also, It is advisable to check the changelog before downloading latest version so that one is well aware of upcoming changes and can make a decision if they want to change the version for specified changes.

⇒ Deciding on number of Threads – JMeter best Practices

  • As discussed in previous lectures, the number of threads corresponds to the number of users hitting the application.
  • And, the load on application tends to increase with users.
  • In order to ensure that memory of the machine is not consumed completely one should limit count specified in Thread groups > Number of Threads.
  • Ideally, it should be between 200-400 from 1 server
  • In order to test with the number higher than this, distribute load to multiple servers and run test.
  • Other factors like Ramp up time, Loop also play a part in the simulation of users.

⇒ Use the right Listener – JMeter best Practices

  • When the script for JMeter is created, reports for same is visualized using Listeners. They help to display results such that it is easier to interpret the behavior of request and response.
  • But, the more visually attractive a listener is more is the memory it takes to create the report.
  • Listeners such as “View Results in Tree”, “Aggregate graph” are heavy memory usage listeners to name a few.
  • While listener like “Simple Data writer”, do not display any tree like structure, graph or table in JMeter UI but it exports the data to CSV thereby consuming way less memory.
  • However, the amount of information displayed in interactive listeners is much more and that is the reason one tends to add them as it makes easier to review each and every request/response in detail.
  • The best solution to this is that in initial phases of script creation uses advanced listeners and monitor requests closely.
  • Once, requests are built successfully and tested for 10 users approx. switch to lighter versions of listeners and disable the heavy duty ones.

⇒ Use Headless version of JMeter – JMeter best Practices

  • Another way to use JMeter effectively without increasing load on memory is by running it in Non-GUI mode.
  • Steps to run JMeter in headless mode are as below :
    • Save your script with .jmx extension say “myScript.jmx” in JMeter GUI and close GUI mode.
    • Open Command prompt.
    • Navigate to “bin” folder of JMeter folder through CMD. [CD pathTillFile]
    • Type below command on CMD

 jmeter -n -t myscript.jmx -l scriptResults.jtl

-n > For non-gui mode

-t > For Filename to be executed

-l > Name of .jtl file to store results

⇒ Naming Convention – JMeter best Practices

Files should be stored with Alphanumeric characters instead of complex names.

Ankita has worked on different types of testing like Manual, Automation, Performance testing.  She likes to learn about new tools in market that help to make testing easier and interesting. Testing is her passion due to versatile areas it offers.

About the author

Ankita Dawar author

Ankita has worked on different types of testing like Manual, Automation, Performance testing.  She likes to learn about new tools in market that help to make testing easier and interesting. Testing is her passion due to versatile areas it offers.

Leave a Reply

Your email address will not be published.