{"id":13910,"date":"2021-01-23T18:57:00","date_gmt":"2021-01-23T18:57:00","guid":{"rendered":"http:\/\/abstracta.us\/blog\/?p=13910"},"modified":"2025-05-05T21:25:46","modified_gmt":"2025-05-05T21:25:46","slug":"k6-review","status":"publish","type":"post","link":"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/","title":{"rendered":"k6 Review: Open Source Load Testing Tool for Developers"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Have you heard the hype around k6 yet? <\/h1>\n\n\n\n<p>Yes, yet another open source performance testing tool is making waves. In this post, I\u2019ll share my k6 review in the hopes that it may help you decide if you should also pay attention to it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Overview\"><\/span>Overview<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/k6.io\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">k6<\/a> is a developer-centric, free, open-source load testing tool that\u2019s been receiving a lot of attention lately. In 2016, the k6 team set out to build a great open source load testing tool (formerly known as <a href=\"https:\/\/loadimpact.com\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">LoadImpact<\/a>) and has been pushing out updates and improvements ever since. <strong>In early 2020, the tool reached two million test runs per month<\/strong>, so it\u2019s fair to say that its user base is already well established and if this growth trend continues, there should be even more to come.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Mission_Behind_k6\"><\/span>The Mission Behind k6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the industry, there has been a need for a load testing tool that is built for teams that everyone is able to use (from developers and testers to DevOps\/SREs). The k6 team achieved this, democratizing load testing by building an application written in Go, (seeking to squeeze as much performance as possible out of the hardware) while the scripting is done using JavaScript. As you could imagine, in a world where JavaScript ranks as the number one most popular programming language by Stack Overflow for three years in a row, having a load testing tool whose scripting is based in it is a great way to lure developers into trying and ultimately, sticking with it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Good\"><\/span>The Good<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>First of all, as I previously mentioned, the fact that its scripting is based in JavaScript is a highlight of k6. Nowadays, full-stack JavaScript developers are more common, so they\u2019re able to integrate a load testing tool into their workflow without having to adjust much or learn new languages\/UIs. However, that doesn\u2019t mean it\u2019s hard to use if you don\u2019t know JS: I\u2019ve spent no more than 150 hours using JS, mostly working with WebdriverIO and Angular and I had no problems at all getting k6 to do whatever it was I wanted it to do. What I mean by this is that <strong>the barrier to entry is low<\/strong>, if there is any at all.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/abstracta.us\/wp-content\/uploads\/2021\/01\/unnamed-min.png\" alt=\"screenshot k6 review\" class=\"wp-image-13912\"\/><\/figure>\n\n\n\n<p>Next is the fact that <strong>k6 has really good documentation<\/strong> (<a href=\"https:\/\/k6.io\/docs\/\">https:\/\/k6.io\/docs\/<\/a>), however, there are certain things that you may find hidden where you\u2019d least expect and it&#8217;s lacking in some specific examples for how to do things.&nbsp;<\/p>\n\n\n\n<p><strong>Another remarkable thing is the number of integrations that k6 manages to handle.<\/strong> You can convert a HAR file to a k6 script, which means you can record a workflow in your browser or in a web debugging proxy tool such as Fiddler or Charles Proxy, save it, and then convert it to a ready-to-go k6 script.&nbsp;<\/p>\n\n\n\n<p>I also find it impressive how you can<strong> convert JMeter scripts, Postman collections and even create a script from an API\u2019s Swagger<\/strong> (I haven\u2019t yet tried any of these options myself but they\u2019re well documented on its website). As expected, k6 also easily integrates with the most common CI\/CD tools such as Jenkins, GitLabCI, GitHub Actions, CircleCI, and more.<br><\/p>\n\n\n\n<p>Finally, its <strong>results reporting is quite good.<\/strong> You can design custom metrics, checks (aka assertions, for those coming from JMeter), create an output of the test result in JSON or integrate it with a number of different data visualization tools such as DataDog, Grafana, or Kafka.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/abstracta.us\/wp-content\/uploads\/2021\/01\/unnamed-1-min.png\" alt=\"k6 report screenshot\" class=\"wp-image-13914\"\/><figcaption>An example of k6&#8217;s reporting<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Not_So_Good\"><\/span>The Not So Good<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you\u2019re coming from other popular tools such as JMeter or Gatling, you might find the way of doing certain things more difficult or somewhat \u201chacky.\u201d I\u2019ll give you two examples of this that I came across when trying to create a script that simulated some simple user behavior interacting with a <a href=\"https:\/\/abstracta.us\/blog\/software-testing\/best-demo-websites-for-practicing-different-types-of-software-tests\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">dummy e-commerce website<\/a>.<\/p>\n\n\n\n<p>First, if you try to group your requests (this might not be the only way to do it, but it was the way I found out) but want to say, get a value from a response to one of the requests in group A and then use it in group B, you have to declare the variable in the supergroup as undefined, then set it in group A and then use it in group B. In JMeter, this is easier to achieve and doesn\u2019t require as much trial-and-error.<\/p>\n\n\n\n<p>Finally, there is no easy way to perform general checks or set acceptance criteria for the whole test. What I mean by this is that when using different groups as I did, you can\u2019t define an error percentage or response time threshold for all of the requests inside each group from the \u201cmaster\u201d group. You can either go ahead and repeat the same checks in each of the subgroups or define custom rates which will act as general checks, but it would be nice to have that feature readily available rather than having to go through the trouble of defining custom checks. This could also be accomplished if <a rel=\"noreferrer noopener\" aria-label=\"Taurus (opens in a new tab)\" href=\"https:\/\/abstracta.us\/blog\/tools\/introduction-taurus-alternative-jmeter\/\" target=\"_blank\">Taurus<\/a> offered a k6 runner, which is not yet implemented.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Comparing_k6_to_Gatling\"><\/span>Comparing k6 to Gatling&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For k6, I think the fairest comparison you could make against similar tools is with <a href=\"https:\/\/gatling.io\/\">Gatling<\/a>.&nbsp;<\/p>\n\n\n\n<p class=\"has-background has-very-light-gray-background-color\"><strong>If you aren\u2019t familiar with Gatling, <\/strong><a href=\"https:\/\/abstracta.us\/blog\/performance-testing\/gatling-tool-review-performance-tests-written-scala\/\"><strong>check out this review<\/strong><\/a><strong> or listen to this <\/strong><a href=\"https:\/\/abstracta.us\/blog\/podcast\/quality-sense-podcast-paul-henri-pillet-why-we-made-gatling\/\"><strong>podcast episode<\/strong><\/a><strong> featuring its CEO, Paul-Henri Pillet.&nbsp;<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ease_of_Use\"><\/span>Ease of Use<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>For me, the barrier to entry is lower with k6 than Gatling. My reasons for this are the fact that JavaScript is more widespread than Scala and also because I found k6\u2019s docs to be more helpful than those of Gatling.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Parameterization\"><\/span>Parameterization<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Parameterization is easier with k6. In Gatling, if you want to change, for example, the number of VUs between runs, you first need to declare a variable in your script, which will then take the value from the maven parameters passed when running the script. However, in k6, you can have a hardcoded value for VUs in your script, run it, then run it again passing a flag and overwrite that value, without needing to touch the script.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Test_Maintenance\"><\/span>Test Maintenance<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Maintenance is easy using both as they\u2019re designed with the \u201cload tests as code\u201d mindset and simulations should be stored in some sort of version control system. Gatling also supports a wide variety of protocols either natively or with help from its users\u2019 communities while k6 only supports HTTP1.1 \/ 2 and WebSockets.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Reporting\"><\/span>Reporting<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>When it comes to reporting, I\u2019d say Gatling is the winner today since k6\u2019s built-in reporting is not quite as advanced. One of Gatling\u2019s best features is its automatic report generation, which creates a really nice webpage that allows you to clearly view and navigate the vast amounts of data logged by the tool. It\u2019s even clearer when executing, while k6 displays little to no information on the terminal when running a simulation until it ends, Gatling has some real-time reporting. In any case, these tools can be integrated with some other open source solution to improve the real-time reporting, such as ELK or Grafana. This capability is important, for example, to cut a test run short if you see failures are happening. However, if integrating k6 with other tools for better data visualization is an option, you can produce really great reports that way.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Load_Distribution\"><\/span>Load Distribution<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>As for distributed load testing, it becomes a bit muddier. Both tools offer a paid, cloud-based version that better support reporting and distributed executions. Gatling however, also offers a free shell script which allows you to distribute your simulation amongst as many machines as you\u2019d like. This script does require some previous configurations in all of the generators though.<br><\/p>\n\n\n\n<p>On the other hand, the k6 team states that its tool is more performant than its competitors\u2019, thus reducing the need for distributed load testing since you can supposedly generate serious load on a single generator, although we couldn\u2019t check this claim (the test sites we were using started rejecting requests when the load got heavy). It seems to me though that this argument falls flat when, for example, you want to distribute the load between different geographic areas in order to simulate more real-world scenarios.&nbsp;&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Final_Verdict\"><\/span>The Final Verdict<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you\u2019ve made it this far through my k6 review, thanks for reading\u2014and I\u2019ve got to say, <strong>I like k6, far more than I thought I would<\/strong>. I believe it has a lot of potential and it\u2019s clear that the k6 team is highly involved, focused on improving it so that it\u2019ll continue growing its user base and features.<br><\/p>\n\n\n\n<p>I encourage anyone interested in new load testing tools to take a crack at k6 and let me know what you think about it in the comments!&nbsp;<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Recommended_for_You\"><\/span>Recommended for You<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/abstracta.us\/blog\/culture\/care-less-people-people-become-careless\/\" target=\"_blank\">3 Key Performance Testing Metrics Every Tester Should Know<\/a><br><a href=\"https:\/\/abstracta.us\/blog\/tools\/14-best-performance-testing-tools-apm-solutions\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"14 Best Performance Testing Tools &amp; APM Solutions (opens in a new tab)\">14 Best Performance Testing Tools &amp; APM Solutions<\/a><\/p>\n\n\n\n<!-- Go to www.addthis.com\/dashboard to customize your tools --><script src=\"\/\/s7.addthis.com\/js\/300\/addthis_widget.js#pubid=ra-58d80a50fc4f926d\" type=\"text\/javascript\"><\/script>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you heard the hype around k6 yet? Yes, yet another open source performance testing tool is making waves. In this post, I\u2019ll share my k6 review in the hopes that it may help you decide if you should also pay attention to it. Overview&#8230;<\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,61],"tags":[50,37],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v14.0.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>k6 Review: Open Source Load Testing Tool for Developers | Abstracta<\/title>\n<meta name=\"description\" content=\"Have you heard all the commotion around this new open source load testing tool? Juan Pablo leaves his k6 review for anyone looking to evaluate it.\" \/>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"k6 Review: Open Source Load Testing Tool for Developers | Abstracta\" \/>\n<meta property=\"og:description\" content=\"Have you heard all the commotion around this new open source load testing tool? Juan Pablo leaves his k6 review for anyone looking to evaluate it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog about AI-powered quality engineering for teams building complex software | Abstracta\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AbstractaQA\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-23T18:57:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-05T21:25:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/abstracta.us\/wp-content\/uploads\/2021\/01\/Copy-of-blog-image-3-3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"560\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@AbstractaUS\" \/>\n<meta name=\"twitter:site\" content=\"@AbstractaUS\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/abstracta.us\/blog\/#website\",\"url\":\"https:\/\/abstracta.us\/blog\/\",\"name\":\"Blog about AI-powered quality engineering for teams building complex software | Abstracta\",\"description\":\"AI-powered quality engineering\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/abstracta.us\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/abstracta.us\/wp-content\/uploads\/2021\/01\/unnamed-min.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/#webpage\",\"url\":\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/\",\"name\":\"k6 Review: Open Source Load Testing Tool for Developers | Abstracta\",\"isPartOf\":{\"@id\":\"https:\/\/abstracta.us\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/#primaryimage\"},\"datePublished\":\"2021-01-23T18:57:00+00:00\",\"dateModified\":\"2025-05-05T21:25:46+00:00\",\"author\":{\"@id\":\"https:\/\/abstracta.us\/blog\/#\/schema\/person\/4e7912c2f3a610b7acef5263c4a1de89\"},\"description\":\"Have you heard all the commotion around this new open source load testing tool? Juan Pablo leaves his k6 review for anyone looking to evaluate it.\",\"breadcrumb\":{\"@id\":\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/\",\"url\":\"https:\/\/abstracta.us\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/performance-testing\/\",\"url\":\"https:\/\/abstracta.us\/blog\/performance-testing\/\",\"name\":\"Performance Testing\"}},{\"@type\":\"ListItem\",\"position\":3,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/\",\"url\":\"https:\/\/abstracta.us\/blog\/performance-testing\/k6-review\/\",\"name\":\"k6 Review: Open Source Load Testing Tool for Developers\"}}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/abstracta.us\/blog\/#\/schema\/person\/4e7912c2f3a610b7acef5263c4a1de89\",\"name\":\"Juan Pablo Sobral\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/abstracta.us\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/65d46e8d821932c443b4928460a43e2a?s=96&d=blank&r=g\",\"caption\":\"Juan Pablo Sobral\"},\"description\":\"Performance Tester, Abstracta\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts\/13910"}],"collection":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/comments?post=13910"}],"version-history":[{"count":11,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts\/13910\/revisions"}],"predecessor-version":[{"id":13973,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/posts\/13910\/revisions\/13973"}],"wp:attachment":[{"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/media?parent=13910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/categories?post=13910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/abstracta.us\/blog\/wp-json\/wp\/v2\/tags?post=13910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}