{"id":11182,"date":"2024-09-04T00:43:46","date_gmt":"2024-09-04T04:43:46","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=11182"},"modified":"2024-09-04T00:43:48","modified_gmt":"2024-09-04T04:43:48","slug":"jmeter-best-practices","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/","title":{"rendered":"JMeter Best Practices"},"content":{"rendered":"<p><a id=\"post-11182-_3r12r7b9wape\"><\/a> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-11183\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11182-1.png\" alt=\"JMeter Best Practices\" width=\"400\" height=\"300\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11182-1.png 400w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11182-1-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>In the decades since the very first release of <a href=\"https:\/\/jmeter.apache.org\/\" target=\"_blank\" rel=\"noopener\">JMeter<\/a>, there has been considerable collective experience gained not only in best practices for performance test design in general, but also in the specific methods for creating JMeter tests. In this article, we will summarize best practices for creating a JMeter test plan. For further reading, a more in-depth <a href=\"https:\/\/jmeter.apache.org\/usermanual\/best-practices.html\" target=\"_blank\" rel=\"noopener\">discussion about best practices<\/a> can be found in the JMeter users manual.<\/p>\n<h3><a id=\"post-11182-_kbv60jfbnl3y\"><\/a>Targeting the Latest Version of JMeter<\/h3>\n<p>The general recommendation is to use the latest JMeter release available for your test. This will allow you to take advantage of the latest performance improvements, as well as bug fixes and security patches. The advice is to avoid versions of JMeter which are older than the previous 3 <a href=\"https:\/\/jmeter.apache.org\/changes.html\" target=\"_blank\" rel=\"noopener\">releases<\/a>.<\/p>\n<h3><a id=\"post-11182-_p5kci7xh2w6\"><\/a>Balancing Performance and Thread Count<\/h3>\n<p>Each test plan is unique, and the performance requirements of each JMeter test will vary. Given a hardware configuration (<em>i.e.<\/em>, load generator server size) the number of threads will need to be matched. Some important considerations when choosing a thread count for your test include:<\/p>\n<ul>\n<li><strong>Response Time Duration<\/strong> \u2013 endpoints in your target test application that return faster cause increased demands on JMeter. This may seem counterintuitive at first, but for tests against simple endpoints that return a quick response, the number of concurrent threads might need to be <em>decreased<\/em> to match performance.<\/li>\n<li><strong>Complexity of Pre- and Post-processing<\/strong> \u2013 heavy logic that runs before or after your requests will consume resources on your load generator server. As a result, you may find that decreasing the thread count on a per-server basis and spreading load out amongst a larger number of servers is the route to go.<\/li>\n<li><strong>Long-running Requests<\/strong> \u2013 for cases where a remote server takes a long time to process a request, this could justify increasing the thread count on your load generator servers. You can take advantage of otherwise idle time waiting for responses to long-running requests.<\/li>\n<\/ul>\n<p>In addition to adjusting absolute thread counts, there are a variety of <a href=\"https:\/\/www.redline13.com\/blog\/2022\/10\/jmeter-custom-thread-groups\/\" target=\"_blank\" rel=\"noopener\">thread-focused plugins<\/a> that JMeter offers. These can spread thread loading over time, or even profile the number of threads at different points in your test to attain maximal efficiency on your load generator servers.<\/p>\n<h3><a id=\"post-11182-_cd6z8fegyqpu\"><\/a>Listeners and Overhead<\/h3>\n<p>When creating and debugging your test, it is necessary to employ aspects of JMeter which incur a CPU overhead cost prior to moving your test into production. The largest is probably the graphical user interface (GUI) which is a necessary component to design your test. In a <a href=\"https:\/\/www.redline13.com\/blog\/2024\/08\/jmeter-console-status-logger\/\" target=\"_blank\" rel=\"noopener\">previous article<\/a>, we talked about how production tests should dispense with the GUI and run in non-GUI mode. Another component that is usually run while designing tests are <a href=\"https:\/\/jmeter.apache.org\/usermanual\/listeners.html\" target=\"_blank\" rel=\"noopener\">listeners<\/a>. The most common of these is the <a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html#View_Results_Tree\" target=\"_blank\" rel=\"noopener\"><em>View Results Tree<\/em><\/a>, which provides basic response viewing capability. Any listener that is added to a JMeter test plan should be removed or disabled prior to moving your test into production, as the added CPU overhead can detract from your test results by negatively impacting load generator performance.<\/p>\n<h3><a id=\"post-11182-_wa21ui1qahkq\"><\/a>Legacy Scripting<\/h3>\n<p>If your test contains scripted elements (<em>e.g.<\/em>, <a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html#JSR223_Sampler\" target=\"_blank\" rel=\"noopener\"><em>JSR223 Samplers<\/em><\/a>), the current advice is to migrate any legacy <em>BeanShell<\/em> scripts to <a href=\"https:\/\/groovy-lang.org\/\" target=\"_blank\" rel=\"noopener\"><em>Groovy<\/em><\/a>. There is a significant performance penalty to using the order scripting framework. In addition to this, <em>Groovy<\/em> also has the ability to benefit from caching and compilation if these features are enabled.<\/p>\n<h3><a id=\"post-11182-_utqzbzireljd\"><\/a>Test Parameterization and Properties<\/h3>\n<p>While not conferring a direct performance benefit, it is recommended best practice to avoid hard-coding commonly changed configuration settings and instead use parameterization. This can be done a number of ways, from basic property variable setting, to <a href=\"https:\/\/www.redline13.com\/blog\/2021\/12\/parameterizing-jmeter-tests-from-csv\/\" target=\"_blank\" rel=\"noopener\">CSV parameterization<\/a> from a data set. In a <a href=\"https:\/\/www.redline13.com\/blog\/2021\/03\/accessing-jmeter-properties-set-as-command-line-options\/\" target=\"_blank\" rel=\"noopener\">previous article<\/a>, we illustrated how to use <em>Advanced JMeter Test Options<\/em> in RedLine13 to achieve easy parameterization of your tests by setting simple command-line arguments.<\/p>\n<h3><a id=\"post-11182-_9kt8lopln82\"><\/a>Avoiding Deprecated Elements<\/h3>\n<p>Much along the same lines as using the latest release of the core JMeter application, it is advised best practice to avoid using elements and plugins which have been deprecated. You can find a list of currently supported and recently deprecated elements in the <a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html\" target=\"_blank\" rel=\"noopener\">JMeter component list<\/a>. As the ecosystem of supported functionality for JMeter evolves, newer components are sometimes added which improve upon previously offered functionality.<\/p>\n<hr>\n<p>Did you know that RedLine13 offers a full-featured, time-limited free trial? <a href=\"https:\/\/www.redline13.com\/Service\" target=\"_blank\" rel=\"noopener\">Sign up now<\/a>, and start testing today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the decades since the very first release of JMeter, there has been considerable collective experience gained not only in best practices for performance test design in general, but also in the specific methods for creating JMeter tests. In this article, we will summarize best practices for creating a JMeter test plan. For further reading, a more in-depth discussion about best practices can be found in the JMeter users manual. Targeting the Latest Version of JMeter<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":11,"featured_media":11183,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[75,101,128,283,299,318,424],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-dkoziel","4":"post-11182","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"post_tag-apache-jmeter","10":"post_tag-best-practices","11":"post_tag-cloud-load-testing","12":"post_tag-jmeter","13":"post_tag-jmeter-plugins","14":"post_tag-load-testing","15":"post_tag-redline13"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JMeter Best Practices - RedLine13<\/title>\n<meta name=\"description\" content=\"In this article, we will summarize the recommended best practices to follow when creating a JMeter test plan.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JMeter Best Practices - RedLine13\" \/>\n<meta property=\"og:description\" content=\"In this article, we will summarize the recommended best practices to follow when creating a JMeter test plan.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-04T04:43:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-04T04:43:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11182-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"David Koziel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Koziel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/\"},\"author\":{\"name\":\"David Koziel\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\"},\"headline\":\"JMeter Best Practices\",\"datePublished\":\"2024-09-04T04:43:46+00:00\",\"dateModified\":\"2024-09-04T04:43:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/\"},\"wordCount\":718,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"keywords\":[\"apache jmeter\",\"best practices\",\"Cloud Load Testing\",\"JMeter\",\"jmeter-plugins\",\"Load Testing\",\"RedLine13\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/\",\"name\":\"JMeter Best Practices - RedLine13\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2024-09-04T04:43:46+00:00\",\"dateModified\":\"2024-09-04T04:43:48+00:00\",\"description\":\"In this article, we will summarize the recommended best practices to follow when creating a JMeter test plan.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JMeter Best Practices\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"name\":\"RedLine13\",\"description\":\"(Almost) Free Load Testing in the Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.redline13.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\",\"name\":\"RedLine13\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"contentUrl\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"width\":300,\"height\":68,\"caption\":\"RedLine13\"},\"image\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\",\"name\":\"David Koziel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"caption\":\"David Koziel\"},\"url\":\"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JMeter Best Practices - RedLine13","description":"In this article, we will summarize the recommended best practices to follow when creating a JMeter test plan.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/","og_locale":"en_US","og_type":"article","og_title":"JMeter Best Practices - RedLine13","og_description":"In this article, we will summarize the recommended best practices to follow when creating a JMeter test plan.","og_url":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/","og_site_name":"RedLine13","article_published_time":"2024-09-04T04:43:46+00:00","article_modified_time":"2024-09-04T04:43:48+00:00","og_image":[{"width":400,"height":300,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11182-1.png","type":"image\/png"}],"author":"David Koziel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Koziel","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/"},"author":{"name":"David Koziel","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20"},"headline":"JMeter Best Practices","datePublished":"2024-09-04T04:43:46+00:00","dateModified":"2024-09-04T04:43:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/"},"wordCount":718,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"keywords":["apache jmeter","best practices","Cloud Load Testing","JMeter","jmeter-plugins","Load Testing","RedLine13"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/","url":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/","name":"JMeter Best Practices - RedLine13","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2024-09-04T04:43:46+00:00","dateModified":"2024-09-04T04:43:48+00:00","description":"In this article, we will summarize the recommended best practices to follow when creating a JMeter test plan.","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-best-practices\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"JMeter Best Practices"}]},{"@type":"WebSite","@id":"https:\/\/www.redline13.com\/blog\/#website","url":"https:\/\/www.redline13.com\/blog\/","name":"RedLine13","description":"(Almost) Free Load Testing in the Cloud","publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redline13.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redline13.com\/blog\/#organization","name":"RedLine13","url":"https:\/\/www.redline13.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","contentUrl":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","width":300,"height":68,"caption":"RedLine13"},"image":{"@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20","name":"David Koziel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","caption":"David Koziel"},"url":"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=11182"}],"version-history":[{"count":2,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11182\/revisions"}],"predecessor-version":[{"id":11185,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11182\/revisions\/11185"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/11183"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=11182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=11182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=11182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}