<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Set up on Grafana Labs</title><link>https://grafana.com/docs/k6/v2.3.x/set-up/</link><description>Recent content in Set up on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/k6/v2.3.x/set-up/index.xml" rel="self" type="application/rss+xml"/><item><title>Install k6</title><link>https://grafana.com/docs/k6/v2.3.x/set-up/install-k6/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/set-up/install-k6/</guid><content><![CDATA[&lt;h1 id=&#34;install-k6&#34;&gt;Install k6&lt;/h1&gt;
&lt;p&gt;k6 has packages for Linux, Mac, and Windows. Alternatively, you can use a Docker container or a standalone binary.&lt;/p&gt;
&lt;p&gt;You can also use the k6 Studio desktop application to help you generate k6 scripts from a browser recording. Refer to &lt;a href=&#34;#k6-studio&#34;&gt;k6 Studio&lt;/a&gt; for more details.&lt;/p&gt;
&lt;h2 id=&#34;linux&#34;&gt;Linux&lt;/h2&gt;
&lt;h3 id=&#34;debianubuntu&#34;&gt;Debian/Ubuntu&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -fsSL https://dl.k6.io/key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/k6-archive-keyring.gpg
echo &amp;#34;deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main&amp;#34; | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;fedoracentos&#34;&gt;Fedora/CentOS&lt;/h3&gt;
&lt;p&gt;Using &lt;code&gt;dnf&lt;/code&gt; (or &lt;code&gt;yum&lt;/code&gt; on older versions):&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo dnf install https://dl.k6.io/rpm/repo.rpm
sudo dnf install k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;macos&#34;&gt;MacOS&lt;/h2&gt;
&lt;p&gt;Using &lt;a href=&#34;https://brew.sh/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Homebrew&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;brew install k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;windows&#34;&gt;Windows&lt;/h2&gt;
&lt;p&gt;If you use the &lt;a href=&#34;https://chocolatey.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Chocolatey package manager&lt;/a&gt; you can install the unofficial k6 package with:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;choco install k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you use the &lt;a href=&#34;https://github.com/microsoft/winget-cli&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Windows Package Manager&lt;/a&gt;, install the official packages from the k6 manifests &lt;a href=&#34;https://github.com/microsoft/winget-pkgs/tree/master/manifests/k/k6/k6&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;(created by the community)&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;winget install k6 --source winget&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Alternatively, you can download and run &lt;a href=&#34;https://dl.k6.io/msi/k6-latest-amd64.msi&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;the latest official installer&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;docker&#34;&gt;Docker&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker pull grafana/k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;We also have a separate image you can use with &lt;code&gt;chromium&lt;/code&gt; installed to run k6 browser tests.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker pull grafana/k6:master-with-browser&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;download-the-k6-binary&#34;&gt;Download the k6 binary&lt;/h2&gt;
&lt;p&gt;Our &lt;a href=&#34;https://github.com/grafana/k6/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;GitHub Releases page&lt;/a&gt; has a standalone binary for all platforms. After downloading and extracting the archive for your platform, place the &lt;code&gt;k6&lt;/code&gt; or &lt;code&gt;k6.exe&lt;/code&gt; binary in your &lt;code&gt;PATH&lt;/code&gt; to run &lt;code&gt;k6&lt;/code&gt; from any location.&lt;/p&gt;
&lt;h2 id=&#34;using-k6-extensions&#34;&gt;Using k6 extensions&lt;/h2&gt;
&lt;p&gt;If you use one or more 
    &lt;a href=&#34;/docs/k6/v2.3.x/extensions/&#34;&gt;k6 extensions&lt;/a&gt;, you need a k6 binary built with your desired extensions.
Head to 
    &lt;a href=&#34;/docs/k6/v2.3.x/extensions/explore/&#34;&gt;Explore extension&lt;/a&gt; to get started.&lt;/p&gt;
&lt;h2 id=&#34;upgrade-k6&#34;&gt;Upgrade k6&lt;/h2&gt;
&lt;p&gt;Upgrade to the latest version of &lt;code&gt;k6&lt;/code&gt; using one of the following commands.&lt;/p&gt;
&lt;h3 id=&#34;linux-debianubuntu&#34;&gt;Linux (Debian/Ubuntu)&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo apt-get update
sudo apt-get install k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;linux-fedoracentos&#34;&gt;Linux (Fedora/CentOS)&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo dnf upgrade k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;macos-1&#34;&gt;MacOS&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;brew upgrade k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;windows-chocolatey&#34;&gt;Windows (Chocolatey)&lt;/h3&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;choco upgrade k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;windows-windows-package-manager&#34;&gt;Windows (Windows Package Manager)&lt;/h3&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;winget upgrade k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;windows-msi-installer&#34;&gt;Windows (MSI installer)&lt;/h3&gt;
&lt;p&gt;Download and run &lt;a href=&#34;https://dl.k6.io/msi/k6-latest-amd64.msi&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;the latest official installer&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;docker-1&#34;&gt;Docker&lt;/h3&gt;
&lt;p&gt;Pull the latest image:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker pull grafana/k6:latest&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;binary&#34;&gt;Binary&lt;/h3&gt;
&lt;p&gt;Download the latest binary from the &lt;a href=&#34;https://github.com/grafana/k6/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;GitHub Releases page&lt;/a&gt;, and replace your existing installation.&lt;/p&gt;
&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If installation fails, check the 
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/install-k6/troubleshooting/&#34;&gt;list of common installation issues&lt;/a&gt;.
If your problem is not listed and persists, open an issue in the &lt;a href=&#34;https://github.com/grafana/k6&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;k6 GitHub repository&lt;/a&gt;, or report it on our &lt;a href=&#34;https://community.grafana.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;community forum&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;k6-studio&#34;&gt;k6 Studio&lt;/h2&gt;
&lt;p&gt;k6 Studio is a desktop application for Windows, macOS, and Linux, that can help you generate k6 scripts from a browser recording, and quickly test your application. You can generate protocol and browser scripts, and test and debug your scripts with a visual interface, without having to touch any code.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For installation instructions, refer to &lt;a href=&#34;/docs/k6-studio/set-up/install/&#34;&gt;Install k6 Studio&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;For more details about k6 Studio, refer to the &lt;a href=&#34;/docs/k6-studio/&#34;&gt;k6 Studio docs&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;p&gt;Now that you have k6 installed in your machine, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Head over to 
    &lt;a href=&#34;/docs/k6/v2.3.x/get-started/running-k6/&#34;&gt;Running k6&lt;/a&gt; to learn how to create and run your first test.&lt;/li&gt;
&lt;li&gt;Refer to 
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/configure-k6-intellisense/&#34;&gt;Configure k6 Intellisense&lt;/a&gt; to set up code editing features to your code editor, such as auto-completion of k6 functions.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="install-k6">Install k6&lt;/h1>
&lt;p>k6 has packages for Linux, Mac, and Windows. Alternatively, you can use a Docker container or a standalone binary.&lt;/p>
&lt;p>You can also use the k6 Studio desktop application to help you generate k6 scripts from a browser recording. Refer to &lt;a href="#k6-studio">k6 Studio&lt;/a> for more details.&lt;/p></description></item><item><title>Configure your code editor</title><link>https://grafana.com/docs/k6/v2.3.x/set-up/configure-your-code-editor/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/set-up/configure-your-code-editor/</guid><content><![CDATA[&lt;h1 id=&#34;configure-your-code-editor&#34;&gt;Configure your code editor&lt;/h1&gt;
&lt;p&gt;&lt;a href=&#34;https://code.visualstudio.com/docs/editor/intellisense&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;IntelliSense&lt;/a&gt; refers to code editing features like &lt;strong&gt;intelligent code completion&lt;/strong&gt; and &lt;strong&gt;quick access to documentation&lt;/strong&gt;. These features can significantly improve the developer experience and productivity when working on k6 scripts in your editor of choice. Notable features are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Auto-completion of k6 functions, methods, and classes.&lt;/li&gt;
&lt;li&gt;Auto imports of k6 modules.&lt;/li&gt;
&lt;li&gt;Access to k6 documentation when writing and hovering code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/k6-oss/intellisense-k6-demo.gif&#34;
  alt=&#34;Intellisense enabled in a code editor, showing autocompletion of k6 libraries&#34; width=&#34;1824&#34;
     height=&#34;928&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;install-k6-type-definitions&#34;&gt;Install k6 type definitions&lt;/h2&gt;
&lt;p&gt;k6 has its &lt;a href=&#34;https://www.npmjs.com/package/@types/k6&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;TypeScript Type Definition&lt;/a&gt; that you can configure with your editor to unlock code editing features.&lt;/p&gt;
&lt;p&gt;In Visual Studio Code and IntelliJ IDEA Ultimate, you can configure IntelliSense to recognize the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/&#34;&gt;k6 JavaScript API&lt;/a&gt; by installing the k6 Types with a package manager.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;# create a `package.json` file
$ npm init --yes

# install the k6 types as dev dependency
$ npm install --save-dev @types/k6&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;code-editor-extensions&#34;&gt;Code editor extensions&lt;/h2&gt;
&lt;p&gt;You can also find k6 code editor extensions for Visual Studio Code and IntelliJ IDEA:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=k6.k6&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Visual Studio Code - k6 Extension&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://plugins.jetbrains.com/plugin/16141-k6&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;IntelliJ IDEA - k6 Plugin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;ai-assistants-mcp&#34;&gt;AI assistants (MCP)&lt;/h2&gt;
&lt;p&gt;Connect k6 authoring and execution tools to MCP-compatible editors or assistants through the k6 MCP server. If you already have k6 installed, you can launch it directly with &lt;code&gt;k6 x mcp&lt;/code&gt; — no extra install required.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/configure-ai-assistant/&#34;&gt;Configure your AI assistant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/configure-ai-assistant/bootstrap-with-k6-x-agent/&#34;&gt;Bootstrap your editor with &lt;code&gt;k6 x agent&lt;/code&gt;&lt;/a&gt; — set up skills and the MCP server in one command for supported editors.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;p&gt;Now that you have k6 configured in your code editor, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Head over to 
    &lt;a href=&#34;/docs/k6/v2.3.x/get-started/running-k6/&#34;&gt;Running k6&lt;/a&gt; to learn how to create and run your first test.&lt;/li&gt;
&lt;li&gt;Configure your editor for &lt;a href=&#34;https://github.com/Microsoft/TypeScript/wiki/TypeScript-Editor-Support&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;TypeScript support&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="configure-your-code-editor">Configure your code editor&lt;/h1>
&lt;p>&lt;a href="https://code.visualstudio.com/docs/editor/intellisense" target="_blank" rel="noopener noreferrer">IntelliSense&lt;/a> refers to code editing features like &lt;strong>intelligent code completion&lt;/strong> and &lt;strong>quick access to documentation&lt;/strong>. These features can significantly improve the developer experience and productivity when working on k6 scripts in your editor of choice. Notable features are:&lt;/p></description></item><item><title>Configure your AI assistant</title><link>https://grafana.com/docs/k6/v2.3.x/set-up/configure-ai-assistant/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/set-up/configure-ai-assistant/</guid><content><![CDATA[&lt;h1 id=&#34;configure-your-ai-assistant&#34;&gt;Configure your AI assistant&lt;/h1&gt;
&lt;p&gt;k6 is AI-native. It ships a dedicated toolset that plugs straight into any modern AI editor or agentic workflow, so your assistant can plan, write, validate, and run k6 tests without leaving your codebase.&lt;/p&gt;
&lt;p&gt;Two k6 subcommands form the integration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;./bootstrap-with-k6-x-agent/&#34;&gt;&lt;code&gt;k6 x agent&lt;/code&gt;&lt;/a&gt; bootstraps your editor in one command. It installs portable k6 skills (planning, smoke / load / browser tests, Playwright→k6 conversion) and registers the MCP server with Claude Code, Cursor, GitHub Copilot, Codex CLI, OpenCode, or Cline.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k6 x mcp&lt;/code&gt; runs the k6 &lt;a href=&#34;https://modelcontextprotocol.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Model Context Protocol&lt;/a&gt; server (currently in preview), exposing the tools, prompts, and resources your assistant calls to validate scripts, look up documentation, and execute tests.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want the fastest path, jump straight to &lt;a href=&#34;./bootstrap-with-k6-x-agent/&#34;&gt;Bootstrap your editor with &lt;code&gt;k6 x agent&lt;/code&gt;&lt;/a&gt;. The rest of this page covers running and configuring the MCP server itself.&lt;/p&gt;
&lt;h2 id=&#34;what-your-assistant-can-do-for-you&#34;&gt;What your assistant can do for you&lt;/h2&gt;
&lt;p&gt;Through the k6 MCP server, your AI assistant can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Write accurate scripts:&lt;/strong&gt; Create up-to-date scripts by &lt;strong&gt;referring to&lt;/strong&gt; embedded k6 documentation and TypeScript definitions to reduce API hallucinations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Validate scripts:&lt;/strong&gt; Catch syntax errors, missing imports, and &lt;code&gt;export default function&lt;/code&gt; declarations before execution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run tests locally:&lt;/strong&gt; Execute scripts and review results without leaving your editor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Generate scripts:&lt;/strong&gt; Create tests from requirements using guided prompts that follow k6 best practices.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Convert browser tests:&lt;/strong&gt; Transform Playwright tests into k6 browser scripts while preserving test logic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automate provisioning:&lt;/strong&gt; Discover Terraform resources in your project to automate Grafana Cloud k6 setup.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;quick-start-with-k6-x-agent&#34;&gt;Quick start with &lt;code&gt;k6 x agent&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The fastest way to wire everything up is the &lt;a href=&#34;./bootstrap-with-k6-x-agent/&#34;&gt;&lt;code&gt;k6 x agent&lt;/code&gt;&lt;/a&gt; command, shipped with k6. From your project root:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;k6 x agent init claude-code   # or: cursor, vscode-copilot, codex-cli, opencode, cline, --all&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;k6 x agent init&lt;/code&gt; registers the k6 MCP server in your editor&amp;rsquo;s MCP config and installs portable k6 skills that auto-activate when you ask your assistant to plan, write, or convert tests. See &lt;a href=&#34;./bootstrap-with-k6-x-agent/&#34;&gt;Bootstrap your editor with &lt;code&gt;k6 x agent&lt;/code&gt;&lt;/a&gt; for the full set of supported editors, bundled skills, and flags.&lt;/p&gt;
&lt;p&gt;If your editor isn&amp;rsquo;t supported by &lt;code&gt;k6 x agent&lt;/code&gt;, or you want to author the configuration yourself, see &lt;a href=&#34;./bootstrap-with-k6-x-agent/#editors-not-supported-by-k6-x-agent&#34;&gt;Editors not supported by &lt;code&gt;k6 x agent&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;run-the-k6-mcp-server&#34;&gt;Run the k6 MCP server&lt;/h2&gt;
&lt;p&gt;The simplest path is to invoke the server through k6 itself. To pin a specific version or run without a k6 install on the host, use the standalone &lt;code&gt;mcp-k6&lt;/code&gt; distribution instead.&lt;/p&gt;
&lt;h3 id=&#34;k6-subcommand-recommended&#34;&gt;k6 subcommand (recommended)&lt;/h3&gt;
&lt;p&gt;If you already have &lt;a href=&#34;../install-k6/&#34;&gt;k6 installed&lt;/a&gt;, you also have the k6 MCP server — invoke it as a subcommand:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;k6 x mcp&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The server is registered as an &lt;a href=&#34;../../extensions/create/subcommand-extensions/#use-automatic-extension-resolution&#34;&gt;official subcommand extension&lt;/a&gt;. The first time you run &lt;code&gt;k6 x mcp&lt;/code&gt;, k6 transparently fetches and runs the extension; subsequent invocations start immediately. By default the server speaks the &lt;strong&gt;stdio&lt;/strong&gt; transport that every MCP client expects.&lt;/p&gt;
&lt;p&gt;To also drop in editor skills and auto-register the server in your editor, use &lt;a href=&#34;./bootstrap-with-k6-x-agent/&#34;&gt;&lt;code&gt;k6 x agent init&lt;/code&gt;&lt;/a&gt; instead of wiring up the server manually.&lt;/p&gt;
&lt;p&gt;Verify the command works:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;k6 x mcp --help&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Auto-extension resolution runs the latest released version. To pin a specific version, use the standalone &lt;code&gt;mcp-k6&lt;/code&gt; distribution below.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;docker&#34;&gt;Docker&lt;/h3&gt;
&lt;p&gt;Pull the image:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;docker pull grafana/mcp-k6:latest
docker run --rm grafana/mcp-k6 --version&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;homebrew-macos&#34;&gt;Homebrew (macOS)&lt;/h3&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;If you run &lt;code&gt;mcp-k6&lt;/code&gt; natively, you must also have k6 installed and available in your PATH.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;


&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;brew tap grafana/grafana
brew install mcp-k6
mcp-k6 --version&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;linux-packages-debrpm&#34;&gt;Linux packages (deb/rpm)&lt;/h3&gt;
&lt;p&gt;Install &lt;code&gt;mcp-k6&lt;/code&gt; from the &lt;code&gt;.deb&lt;/code&gt; or &lt;code&gt;.rpm&lt;/code&gt; packages published on the &lt;a href=&#34;https://github.com/grafana/mcp-k6/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;mcp-k6 GitHub releases&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the releases page and select a version.&lt;/li&gt;
&lt;li&gt;Download the package that matches your Linux distribution and CPU architecture.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can check your CPU architecture with:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;uname -m&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Use the following mapping to pick the right asset:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;code&gt;uname -m&lt;/code&gt;&lt;/th&gt;
              &lt;th&gt;Debian/Ubuntu asset&lt;/th&gt;
              &lt;th&gt;Fedora/RHEL asset&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;x86_64&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;amd64&lt;/code&gt; (&lt;code&gt;.deb&lt;/code&gt;)&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;x86_64&lt;/code&gt; (&lt;code&gt;.rpm&lt;/code&gt;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;aarch64&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;arm64&lt;/code&gt; (&lt;code&gt;.deb&lt;/code&gt;)&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;aarch64&lt;/code&gt; (&lt;code&gt;.rpm&lt;/code&gt;)&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h4 id=&#34;debianubuntu-deb&#34;&gt;Debian/Ubuntu (&lt;code&gt;.deb&lt;/code&gt;)&lt;/h4&gt;
&lt;p&gt;If you have the GitHub CLI (&lt;code&gt;gh&lt;/code&gt;) installed, you can download a specific release asset from the terminal:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;MCP_K6_VERSION=&amp;#34;vX.Y.Z&amp;#34;

# For amd64/x86_64:
gh release download &amp;#34;$MCP_K6_VERSION&amp;#34; --repo grafana/mcp-k6 --pattern &amp;#34;*linux*amd64*.deb&amp;#34;

# For arm64/aarch64:
# gh release download &amp;#34;$MCP_K6_VERSION&amp;#34; --repo grafana/mcp-k6 --pattern &amp;#34;*linux*arm64*.deb&amp;#34;

sudo apt install ./mcp-k6_*.deb
mcp-k6 --version&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you downloaded the &lt;code&gt;.deb&lt;/code&gt; in your browser, run &lt;code&gt;apt&lt;/code&gt; from the directory where you saved it:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;sudo apt install ./mcp-k6_*.deb
mcp-k6 --version&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;fedorarhel-rpm&#34;&gt;Fedora/RHEL (&lt;code&gt;.rpm&lt;/code&gt;)&lt;/h4&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;MCP_K6_VERSION=&amp;#34;vX.Y.Z&amp;#34;

# For x86_64:
gh release download &amp;#34;$MCP_K6_VERSION&amp;#34; --repo grafana/mcp-k6 --pattern &amp;#34;*linux*x86_64*.rpm&amp;#34;

# For aarch64:
# gh release download &amp;#34;$MCP_K6_VERSION&amp;#34; --repo grafana/mcp-k6 --pattern &amp;#34;*linux*aarch64*.rpm&amp;#34;

sudo dnf install ./mcp-k6-*.rpm
mcp-k6 --version&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If your distro uses &lt;code&gt;yum&lt;/code&gt; instead of &lt;code&gt;dnf&lt;/code&gt;, run:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;sudo yum install ./mcp-k6-*.rpm&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;build-from-source&#34;&gt;Build from source&lt;/h3&gt;
&lt;p&gt;Clone and install with &lt;code&gt;make&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;git clone https://github.com/grafana/mcp-k6
cd mcp-k6
make install&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;server-flags&#34;&gt;Server flags&lt;/h2&gt;
&lt;p&gt;The k6 MCP server accepts the following flags, whether you launch it via &lt;code&gt;k6 x mcp&lt;/code&gt; or the standalone &lt;code&gt;mcp-k6&lt;/code&gt; binary:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Flag&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;--transport&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;stdio&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Transport to use: &lt;code&gt;stdio&lt;/code&gt; or &lt;code&gt;http&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;--addr&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;:8080&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Listen address (HTTP transport only).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;--endpoint&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;/mcp&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;HTTP endpoint path (HTTP transport only).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;--stateless&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Disable session tracking (HTTP transport only).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;--preload&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Download all embedded documentation bundles at startup.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;run-over-http&#34;&gt;Run over HTTP&lt;/h3&gt;
&lt;p&gt;For shared development hosts where multiple clients connect to one server, start the k6 MCP server with the streamable HTTP transport:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;k6 x mcp --transport=http --addr=:8080&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Clients then connect to &lt;code&gt;http://&amp;lt;host&amp;gt;:8080/mcp&lt;/code&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;The HTTP transport has no built-in authentication. Don&amp;rsquo;t expose it on a public network — bind it to localhost or a trusted internal interface, and put it behind your own auth proxy if multiple users need access.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If your AI assistant cannot connect to the server:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Check the logs:&lt;/strong&gt; Most editors (like Cursor or VS Code) have an &amp;ldquo;MCP Output&amp;rdquo; or &amp;ldquo;Logs&amp;rdquo; tab. Check there for &amp;ldquo;command not found&amp;rdquo; errors.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verify k6 is on PATH:&lt;/strong&gt; If running via &lt;code&gt;k6 x mcp&lt;/code&gt;, run &lt;code&gt;which k6&lt;/code&gt; to confirm k6 is globally accessible. If running natively, also run &lt;code&gt;which mcp-k6&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check k6 version:&lt;/strong&gt; Auto-extension resolution requires a recent k6 release. Run &lt;code&gt;k6 version&lt;/code&gt; and confirm you&amp;rsquo;re on a version that supports &lt;code&gt;k6 x&lt;/code&gt; subcommands.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Docker permissions:&lt;/strong&gt; Ensure the Docker daemon is running and that your user has permission to execute &lt;code&gt;docker run&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use MCP Inspector:&lt;/strong&gt; Use the &lt;a href=&#34;https://modelcontextprotocol.io/docs/tools/inspector&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;MCP Inspector&lt;/a&gt; to debug the connection independently of your editor.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;configure-your-editor&#34;&gt;Configure your editor&lt;/h3&gt;
&lt;p&gt;Once &lt;code&gt;k6 x mcp&lt;/code&gt; runs (or you&amp;rsquo;ve installed &lt;code&gt;mcp-k6&lt;/code&gt; standalone), wire it up to your editor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;./bootstrap-with-k6-x-agent/&#34;&gt;Bootstrap your editor with &lt;code&gt;k6 x agent&lt;/code&gt;&lt;/a&gt; — one-command setup for Claude Code, Cursor, GitHub Copilot, Codex CLI, OpenCode, and Cline. Manual setup for other MCP clients is documented at the bottom of the same page.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Learn about available tools, prompts, and resources: &lt;a href=&#34;./tools-prompts-resources/&#34;&gt;Tools, prompts, and resources&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="configure-your-ai-assistant">Configure your AI assistant&lt;/h1>
&lt;p>k6 is AI-native. It ships a dedicated toolset that plugs straight into any modern AI editor or agentic workflow, so your assistant can plan, write, validate, and run k6 tests without leaving your codebase.&lt;/p></description></item><item><title>Set up distributed k6</title><link>https://grafana.com/docs/k6/v2.3.x/set-up/set-up-distributed-k6/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/set-up/set-up-distributed-k6/</guid><content><![CDATA[&lt;h1 id=&#34;set-up-distributed-k6&#34;&gt;Set up distributed k6&lt;/h1&gt;
&lt;p&gt;It&amp;rsquo;s possible to run large load tests even when using a single node, or single machine. But, depending on your use case, you might also want to run a distributed Grafana k6 test in your own infrastructure.&lt;/p&gt;
&lt;p&gt;A couple of reasons why you might want to do this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You run your application in Kubernetes and would like k6 to be executed in the same fashion as all your other infrastructure components.&lt;/li&gt;
&lt;li&gt;You want to run your tests within your private network for security and/or privacy reasons.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/grafana/k6-operator&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;k6 Operator&lt;/a&gt; is a Kubernetes operator that you can use to run distributed k6 tests in your cluster.&lt;/p&gt;
&lt;p&gt;This section includes the following topics:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/install-k6-operator/&#34;&gt;Install k6 Operator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/upgrade-k6-operator/&#34;&gt;Upgrade the k6 Operator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/browser-tests/&#34;&gt;Run browser tests in Kubernetes&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/usage/&#34;&gt;Usage&lt;/a&gt;&lt;ul&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/usage/executing-k6-scripts-with-testrun-crd/&#34;&gt;Run k6 scripts with TestRun CRD&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/usage/extensions/&#34;&gt;Use k6 Operator with k6 extensions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/usage/k6-operator-to-gck6/&#34;&gt;Use the k6 Operator with Grafana Cloud k6&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/usage/configure-testrun-crd/&#34;&gt;Configure the TestRun CRD&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/usage/scheduling-tests/&#34;&gt;Schedule k6 tests&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/usage/istio/&#34;&gt;Use the k6 Operator with Istio&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/set-up/set-up-distributed-k6/troubleshooting/&#34;&gt;Troubleshoot&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
]]></content><description>&lt;h1 id="set-up-distributed-k6">Set up distributed k6&lt;/h1>
&lt;p>It&amp;rsquo;s possible to run large load tests even when using a single node, or single machine. But, depending on your use case, you might also want to run a distributed Grafana k6 test in your own infrastructure.&lt;/p></description></item><item><title>Fine-tune OS</title><link>https://grafana.com/docs/k6/v2.3.x/set-up/fine-tune-os/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/set-up/fine-tune-os/</guid><content><![CDATA[&lt;h1 id=&#34;fine-tune-os&#34;&gt;Fine-tune OS&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;This page focuses on helping users run large test scripts locally. If you&amp;rsquo;re just getting started with k6, and haven&amp;rsquo;t run into a &lt;code&gt;Too Many Open Files&lt;/code&gt; error, you can skip these instructions.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;When running large test scripts locally, users sometimes run into limits within their OS that prevent them from making the necessary number of requests to complete the test.
This limit usually manifests itself in a &lt;code&gt;Too Many Open Files&lt;/code&gt; error.
These limits, if unchanged, can be a severe bottleneck if you choose to run a bigger or complicated test locally on your machine.&lt;/p&gt;
&lt;p&gt;This article shows you how to inspect the OS-imposed limits of your system, tweak them, and scale for larger tests.&lt;/p&gt;
&lt;p&gt;Important to note here is that everything that we cover in this article needs to be approached with a healthy dose of caution.
As with any changes to your OS, we discourage blindly changing your system settings to a specific value. You should document ways of testing that shows a clear before-and-after relation.
E.g. before changing MSL / TIME_WAIT period, confirm that you’re experiencing the issue (error messages, netstat, ss, etc.), change settings conservatively, re-run the test, and note any improvement.
This way you can gauge the effect of the optimization, find any negative side-effects, and come up with a range of recommended values.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The following modifications have been tested for Linux, and macOS Sierra 10.12 and above. If you&amp;rsquo;re using an older macOS version, the process for changing these settings might differ.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;network-resource-limit&#34;&gt;Network resource limit&lt;/h2&gt;
&lt;p&gt;Unix operating system derivatives such as GNU/Linux, BSDs and macOS, can limit the amount of system resources available to a process to safeguard system stability. This includes the total amount of memory, CPU time, or amount of open files a single process is allowed to manage.&lt;/p&gt;
&lt;p&gt;Since in Unix everything is a file, including network connections, application testing tools that heavily use the network, such as k6, might reach the configured limit of allowed open files, depending on the amount of network connections used in a particular test.&lt;/p&gt;
&lt;p&gt;As mentioned in our opening section, this results in a message like the following being shown during a test:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;WARN[0127] Request Failed     error=&amp;#34;Get http://example.com/: dial tcp example.com: socket: too many open files&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This message means that the network resource limit has been reached, which will prevent k6 from creating new connections, thus altering the test result. In some cases this may be desired, to measure overall system performance, for example, but in most cases this will be a bottleneck towards testing the HTTP server and web application itself.&lt;/p&gt;
&lt;p&gt;The next sections describe ways to increase this resource limit, and allow k6 to run tests with hundreds or thousands of concurrent VUs from a single system.&lt;/p&gt;
&lt;h3 id=&#34;viewing-limits-configuration&#34;&gt;Viewing limits configuration&lt;/h3&gt;
&lt;p&gt;Unix systems have two types of resource limits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hard limits.&lt;/strong&gt; The absolute maximum allowed for each user, and can be configured only by the root user.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Soft limits.&lt;/strong&gt; These can be configured by each user, but cannot be above the hard limit setting.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;linux&#34;&gt;Linux&lt;/h3&gt;
&lt;p&gt;On GNU/Linux, you can see the configured limits with the ulimit command.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ulimit -Sa&lt;/code&gt; will show all soft limits for the current user:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;$ ulimit -Sa
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 3736
max locked memory       (kbytes, -l) 16384
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 3736
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;While &lt;code&gt;ulimit -Ha&lt;/code&gt; will show all hard limits for the current user:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;$ ulimit -Ha
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 3736
max locked memory       (kbytes, -l) 16384
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1048576
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) unlimited
cpu time               (seconds, -t) unlimited
max user processes              (-u) 3736
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note the difference of open files being a maximum of 1024 for the soft limit, while it&amp;rsquo;s 1048576 for the hard limit.&lt;/p&gt;
&lt;h3 id=&#34;macos&#34;&gt;macOS&lt;/h3&gt;
&lt;p&gt;In macOS however, you will have a couple of different system imposed limits to take into consideration.&lt;/p&gt;
&lt;p&gt;The first one is &lt;code&gt;launchctl limit maxfiles&lt;/code&gt; which prints the per-process limits which are specified also as a soft limit and a hard limit. When a soft limit is exceeded a process may receive a signal (for example, if the CPU time or file size is exceeded), but it will be allowed to continue execution until it reaches the hard limit (or modifies its resource limit).
&lt;code&gt;kern.maxfiles&lt;/code&gt; is the limit of total file descriptors on the entire system - the sum total of all the open files for all processes plus all the files the kernel has open for its own purposes.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sysctl kern.maxfiles&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sysctl kern.maxfilesperproc&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So, to reiterate, running commands above will show you the system limits on open files and running processes.&lt;/p&gt;
&lt;h2 id=&#34;changing-limits-configuration&#34;&gt;Changing limits configuration&lt;/h2&gt;
&lt;p&gt;The first thing you should consider before changing the configuration is the amount of network connections you expect your test to require. The http_reqs metric in the k6 result summary can hint at this, but a baseline calculation of number of max. VUs * number of HTTP requests in a single VU iteration will deliver a fair approximation. Note that k6 also deals with text files and other resources that count towards the &amp;ldquo;open files&amp;rdquo; quota, but network connections are the biggest consumers.&lt;/p&gt;
&lt;h3 id=&#34;disabling-limits-in-macos&#34;&gt;Disabling limits in macOS&lt;/h3&gt;
&lt;p&gt;Before we can change any system imposed limits in macOS we will need to disable a security feature put in place to prevent us in doing so. You will need to disable System Integrity Protection that was introduced in OS X El Capitan to prevent certain system-owned files and directories from being modified by processes without the proper privileges.&lt;/p&gt;
&lt;p&gt;To disable it you will need to restart your Mac and hold down &lt;code&gt;Command &#43; R&lt;/code&gt; while it boots. This will boot it into Recovery Mode.&lt;/p&gt;
&lt;p&gt;There you should navigate to &lt;code&gt;Utilities&lt;/code&gt; which are located in the menu bar at the top of the screen, then open &lt;code&gt;Terminal&lt;/code&gt;. Once you have it open, enter the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;csrutil disable&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Once you press enter and close the Terminal, you can reboot your Mac normally and log into your account.&lt;/p&gt;
&lt;h3 id=&#34;changing-soft-limits&#34;&gt;Changing soft limits&lt;/h3&gt;
&lt;h4 id=&#34;linux-1&#34;&gt;Linux&lt;/h4&gt;
&lt;p&gt;So, let&amp;rsquo;s say that we want to run a 1000 VU test which makes 4 HTTP requests per iteration. In this case we could increase the open files limit to 5000, to account for additional non-network file usage. This can be done with the following command:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;$ ulimit -n 5000&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This changes the limit only for the current shell session.&lt;/p&gt;
&lt;p&gt;If we want to persist this change for future sessions, we can add this to a shell startup file. For Bash this would be:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;$ echo &amp;#34;ulimit -n 5000&amp;#34; &amp;gt;&amp;gt; ~/.bashrc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;macos-1&#34;&gt;macOS&lt;/h4&gt;
&lt;p&gt;If the soft limit is too low, set the current session to (values written here are usually close to default ones) :&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo launchctl limit maxfiles 65536 200000&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Since sudo is needed, you are prompted for a password.&lt;/p&gt;
&lt;h3 id=&#34;changing-hard-limits&#34;&gt;Changing hard limits&lt;/h3&gt;
&lt;h4 id=&#34;linux-2&#34;&gt;Linux&lt;/h4&gt;
&lt;p&gt;If the above command results in an error like cannot modify limit: Operation not permitted or value exceeds hard limit, that means that the hard limit is too low, which as mentioned before, can only be changed by the root user.&lt;/p&gt;
&lt;p&gt;This can be done by modifying the &lt;code&gt;/etc/security/limits.conf&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;For example, to set both soft and hard limits of the amount of open files per process for the alice account, open &lt;code&gt;/etc/security/limits.conf&lt;/code&gt; as root in your text editor of choice and add the following lines:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;alice soft nofile 5000
alice hard nofile 1048576&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The new limits will be in place after logging out and back in.&lt;/p&gt;
&lt;p&gt;Alternatively, * hard nofile 1048576 would apply the setting for all non-root user accounts, and root hard nofile 1048576 for the root user. See the documentation in that file or man bash for the ulimit command documentation.&lt;/p&gt;
&lt;h4 id=&#34;macos-2&#34;&gt;macOS&lt;/h4&gt;
&lt;p&gt;Next step will be to configure your new file limits. Open terminal and paste the following command:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo nano /Library/LaunchDaemons/limit.maxfiles.plist&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This will open a text editor inside your terminal window where you will be prompted to provide your user password and then paste the following:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;markup&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-markup&#34;&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-8&amp;#34;?&amp;gt;
&amp;lt;!DOCTYPE plist PUBLIC &amp;#34;-//Apple//DTD PLIST 1.0//EN&amp;#34;
 &amp;#34;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;#34;&amp;gt;
&amp;lt;plist version=&amp;#34;1.0&amp;#34;&amp;gt;
 &amp;lt;dict&amp;gt;
 &amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;
 &amp;lt;string&amp;gt;limit.maxfiles&amp;lt;/string&amp;gt;
 &amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;
 &amp;lt;array&amp;gt;
 &amp;lt;string&amp;gt;launchctl&amp;lt;/string&amp;gt;
 &amp;lt;string&amp;gt;limit&amp;lt;/string&amp;gt;
 &amp;lt;string&amp;gt;maxfiles&amp;lt;/string&amp;gt;
 &amp;lt;string&amp;gt;64000&amp;lt;/string&amp;gt;
 &amp;lt;string&amp;gt;524288&amp;lt;/string&amp;gt;
 &amp;lt;/array&amp;gt;
 &amp;lt;key&amp;gt;RunAtLoad&amp;lt;/key&amp;gt;
 &amp;lt;true/&amp;gt;
 &amp;lt;key&amp;gt;ServiceIPC&amp;lt;/key&amp;gt;
 &amp;lt;false/&amp;gt;
 &amp;lt;/dict&amp;gt;
&amp;lt;/plist&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Pressing &lt;code&gt;Control &#43; X&lt;/code&gt; will save the changes and exit the editor. By pasting and saving this we have introduced two different limitations to your maxfiles limit. The first one (64000) is a soft limit, which if reached, will prompt your Mac to prepare to stop allowing new file opens but still let them open. If the second one is reached (524288), a hard limit, you will again start seeing your old friend, the &amp;rsquo;too many open files&amp;rsquo; error message.&lt;/p&gt;
&lt;p&gt;We will use the same procedure to increase the processes limit next.&lt;/p&gt;
&lt;p&gt;While in Terminal create a similar file with this command:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;sudo nano /Library/LaunchDaemons/limit.maxproc.plist&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Again, after prompted for your password, you can paste the following and save and close with &lt;code&gt;Control &#43; X&lt;/code&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;markup&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-markup&#34;&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-8&amp;#34;?&amp;gt;
&amp;lt;!DOCTYPE plist PUBLIC &amp;#34;-//Apple/DTD PLIST 1.0//EN&amp;#34; &amp;#34;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;#34;&amp;gt;
 &amp;lt;plist version=&amp;#34;1.0&amp;#34;&amp;gt;
 &amp;lt;dict&amp;gt;
 &amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;
 &amp;lt;string&amp;gt;limit.maxproc&amp;lt;/string&amp;gt;
 &amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;
 &amp;lt;array&amp;gt;
 &amp;lt;string&amp;gt;launchctl&amp;lt;/string&amp;gt;
 &amp;lt;string&amp;gt;limit&amp;lt;/string&amp;gt;
 &amp;lt;string&amp;gt;maxproc&amp;lt;/string&amp;gt;
 &amp;lt;string&amp;gt;2048&amp;lt;/string&amp;gt;
 &amp;lt;string&amp;gt;4096&amp;lt;/string&amp;gt;
 &amp;lt;/array&amp;gt;
 &amp;lt;key&amp;gt;RunAtLoad&amp;lt;/key&amp;gt;
 &amp;lt;true /&amp;gt;
 &amp;lt;key&amp;gt;ServiceIPC&amp;lt;/key&amp;gt;
 &amp;lt;false /&amp;gt;
 &amp;lt;/dict&amp;gt;
 &amp;lt;/plist&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;All that is left after this is to reboot your Mac back to the Recovery Mode, open the Terminal, turn the SIP back on with &lt;code&gt;csrutil enable&lt;/code&gt; and check if the limits were changed with commands we used at the beginning.&lt;/p&gt;
&lt;p&gt;In most cases these limits should be enough to run most of your simple tests locally for some time, but you can modify the files above to any values you will need in your testing.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Please be aware that all of these limitations are put in place to protect your operating system from files and applications that are poorly written and might leak memory like in huge quantities. We would suggest not going too overboard with the values, or you might find your system slowing down to a crawl if or when it runs out of RAM.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;local-port-range&#34;&gt;Local port range&lt;/h2&gt;
&lt;p&gt;When creating an outgoing network connection the kernel allocates a local (source) port for the connection from a range of available ports.&lt;/p&gt;
&lt;h3 id=&#34;gnulinux&#34;&gt;GNU/Linux&lt;/h3&gt;
&lt;p&gt;On GNU/Linux you can see this range with:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;$ sysctl net.ipv4.ip_local_port_range net.ipv4.ip_local_port_range = 32768 60999&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;While 28,231 ports might be sufficient for most use cases, this might be a limiting factor if you’re testing with thousands of connections. You can increase it with, for example:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;sysctl -w net.ipv4.ip_local_port_range=&amp;#34;16384 65000&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Be aware that this range applies to both TCP and UDP, so be conservative with the values you choose and increase as needed.&lt;/p&gt;
&lt;p&gt;To make the changes permanent, add &lt;code&gt;net.ipv4.ip_local_port_range=16384 65000&lt;/code&gt; to &lt;code&gt;/etc/sysctl.conf&lt;/code&gt;.
Last resort tweaks
If you still experience network issues with the above changes, consider enabling net.ipv4.tcp_tw_reuse:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;sysctl -w net.ipv4.tcp_tw_reuse=1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This will enable a feature to quickly reuse connections in TIME_WAIT state, potentially yielding higher throughput.&lt;/p&gt;
&lt;h3 id=&#34;macoslinux&#34;&gt;macOS/Linux&lt;/h3&gt;
&lt;p&gt;On macOS the default ephemeral port range is 49152 to 65535, for a total of 16384 ports. You can check this with the sysctl command:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;$ sysctl net.inet.ip.portrange.first net.inet.ip.portrange.last

net.inet.ip.portrange.first: 49152
net.inet.ip.portrange.last: 65535&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Once you run out of ephemeral ports, you will normally need to wait until the TIME_WAIT state expires (2 * maximum segment lifetime) until you can reuse a particular port number. You can double the number of ports by changing the range to start at 32768, which is the default on Linux and Solaris. (The maximum port number is 65535 so you cannot increase the high end.)&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;$ sudo sysctl -w net.inet.ip.portrange.first=32768

net.inet.ip.portrange.first: 49152 -&amp;gt; 32768&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note that the official range designated by IANA is 49152 to 65535, and some firewalls may assume that dynamically assigned ports fall within that range. You may need to reconfigure your firewall to use a larger range outside of your local network.&lt;/p&gt;
&lt;h2 id=&#34;general-optimizations&#34;&gt;General optimizations&lt;/h2&gt;
&lt;p&gt;This section goes over some optimizations that are not necessarily dependant on your OS, but may affect your testing.&lt;/p&gt;
&lt;h3 id=&#34;ram-usage&#34;&gt;RAM usage&lt;/h3&gt;
&lt;p&gt;Depending on the particular k6 test: maximum number of VUs used, number and size of JavaScript dependencies, and complexity of the test script itself, k6 can consume large amounts of system RAM during test execution. While the development is focused on reducing RAM usage as much as possible, a single test run might use tens of gigabytes of RAM under certain scenarios.&lt;/p&gt;
&lt;p&gt;As a baseline, count each VU instance to require between 1MB and 5MB of RAM, depending on your script complexity and dependencies. This is roughly between 1GB and 5GB of required system RAM for a 1,000 VU test, so make sure that sufficient physical RAM is available to meet your test demands.&lt;/p&gt;
&lt;p&gt;If you need to decrease the RAM usage, you could use the option &lt;code&gt;--compatibility-mode=base&lt;/code&gt;. Read more on 
    &lt;a href=&#34;/docs/k6/v2.3.x/using-k6/javascript-compatibility-mode/&#34;&gt;JavaScript Compatibility Mode&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;virtual-memory&#34;&gt;Virtual memory&lt;/h3&gt;
&lt;p&gt;In addition to physical RAM, ensure that the system is configured with an appropriate amount of virtual memory, or swap space, in case higher memory usage bursts are required.&lt;/p&gt;
&lt;p&gt;You can see the status and amount of available swap space on your system with the commands swapon or free.&lt;/p&gt;
&lt;p&gt;We won&amp;rsquo;t go into swap configuration details here, but you can find several guides online.&lt;/p&gt;
&lt;h3 id=&#34;network-performance&#34;&gt;Network performance&lt;/h3&gt;
&lt;p&gt;Because k6 can generate and sustain large amounts of network traffic, it also stresses the network stack of modern operating systems. Under certain loads or network conditions it&amp;rsquo;s possible to achieve higher throughput and better performance by tweaking some network settings of the operating system or restructuring the network conditions of the test.&lt;/p&gt;
&lt;h3 id=&#34;tcp-time_wait-period&#34;&gt;TCP TIME_WAIT period&lt;/h3&gt;
&lt;p&gt;TCP network applications, such as web clients and servers, are assigned a network socket pair (a unique combination of local address, local port, remote address, and remote port) for each incoming or outgoing connection. Typically this socket pair is used for a single HTTP request/response session, and closed soon after. However, even after a connection is successfully closed by the application, the kernel might still reserve resources for quickly reopening the same socket if a new matching TCP segment arrives. This also occurs during network congestion where some packets get lost in transmission. This places the socket in a TIME_WAIT state, and is released once the TIME_WAIT period expires. This period is typically configured between 15 seconds and 2 minutes.&lt;/p&gt;
&lt;p&gt;The problem some applications like k6 might run into is causing a high number of connections to end up in the TIME_WAIT state, which can prevent new network connections being created.&lt;/p&gt;
&lt;p&gt;In these scenarios, before making changes to the system network configuration, which might have adverse side-effects for other applications, it&amp;rsquo;s preferable to first take some common testing precautions.
Use different server ports or IPs&lt;/p&gt;
&lt;p&gt;Since sockets are uniquely created for a combination of local address, local port, remote address and remote port, a safe workaround for avoiding TIME_WAIT congestion is using different server ports or IP addresses.&lt;/p&gt;
&lt;p&gt;For example, you can configure your application to run on ports :8080, :8081, :8082, etc. and spread out your HTTP requests across these endpoints.&lt;/p&gt;
&lt;h2 id=&#34;read-more&#34;&gt;Read more&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/testing-guides/running-large-tests/&#34;&gt;Running large tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/using-k6/javascript-compatibility-mode/&#34;&gt;JavaScript Compatibility Mode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="fine-tune-os">Fine-tune OS&lt;/h1>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>This page focuses on helping users run large test scripts locally. If you&amp;rsquo;re just getting started with k6, and haven&amp;rsquo;t run into a &lt;code>Too Many Open Files&lt;/code> error, you can skip these instructions.&lt;/p></description></item><item><title>Usage collection</title><link>https://grafana.com/docs/k6/v2.3.x/set-up/usage-collection/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/set-up/usage-collection/</guid><content><![CDATA[&lt;h1 id=&#34;usage-collection&#34;&gt;Usage collection&lt;/h1&gt;
&lt;p&gt;By default, k6 sends an anonymous usage report each time it is run, so that we can track relevant information to be able to build the product making better data-driven decisions. Prioritizing the features that benefit the most and reducing the impact of changes.&lt;/p&gt;
&lt;p&gt;The report can be turned off by setting the 
    &lt;a href=&#34;/docs/k6/v2.3.x/using-k6/k6-options/reference/#no-usage-report&#34;&gt;no usage report&lt;/a&gt; option setting the environment variable &lt;code&gt;K6_NO_USAGE_REPORT&lt;/code&gt; or by adding the flag &lt;code&gt;--no-usage-report&lt;/code&gt; when executing k6.&lt;/p&gt;
&lt;p&gt;The usage report does not contain any information about what you are testing. The contents are the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An anonymous installation ID (&lt;code&gt;installation_id&lt;/code&gt;), described below.&lt;/li&gt;
&lt;li&gt;The k6 version (string, e.g. &amp;ldquo;0.17.2&amp;rdquo;)&lt;/li&gt;
&lt;li&gt;Max VUs configured (number)&lt;/li&gt;
&lt;li&gt;Test duration (number)&lt;/li&gt;
&lt;li&gt;Total stages duration (number)&lt;/li&gt;
&lt;li&gt;VU iterations configured (number)&lt;/li&gt;
&lt;li&gt;The running program&amp;rsquo;s operating system target (&lt;code&gt;darwin&lt;/code&gt;, &lt;code&gt;freebsd&lt;/code&gt;, &lt;code&gt;linux&lt;/code&gt;&amp;hellip;)&lt;/li&gt;
&lt;li&gt;The running program&amp;rsquo;s architecture target (386, amd64, arm, s390x&amp;hellip;)&lt;/li&gt;
&lt;li&gt;The list of JavaScript imported modules (&lt;code&gt;k6/http&lt;/code&gt;, &lt;code&gt;k6/experimental/webcrypto&lt;/code&gt;, &amp;hellip;)&lt;/li&gt;
&lt;li&gt;The list of used outputs (&lt;code&gt;json&lt;/code&gt;, &lt;code&gt;influxdb&lt;/code&gt;, &amp;hellip;)&lt;/li&gt;
&lt;li&gt;The list of used extensions, each with its Go module path, version, and type (&lt;code&gt;js&lt;/code&gt;, &lt;code&gt;output&lt;/code&gt;, or &lt;code&gt;subcommand&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The test run ID if the test was executed in the cloud or was outputed to it&lt;/li&gt;
&lt;li&gt;The number of parsed files and how many were TypeScript files.&lt;/li&gt;
&lt;li&gt;The number of times &lt;code&gt;require&lt;/code&gt; was called.&lt;/li&gt;
&lt;li&gt;The build origin of k6 (&lt;code&gt;release&lt;/code&gt;, &lt;code&gt;xk6&lt;/code&gt;, &lt;code&gt;provisioning&lt;/code&gt;, &amp;hellip;)&lt;/li&gt;
&lt;li&gt;Whether &lt;code&gt;global&lt;/code&gt; was accessed.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The module and output lists contain only k6 built-in names. An extension is reported only if it&amp;rsquo;s listed in the public 
    &lt;a href=&#34;/docs/k6/v2.3.x/extensions/explore/&#34;&gt;k6 extension catalog&lt;/a&gt;. Private and unlisted extensions are never reported.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Running an extension subcommand (&lt;code&gt;k6 x &amp;lt;name&amp;gt;&lt;/code&gt;) also sends a usage report. It contains the anonymous installation ID, the k6 version, the operating system and architecture targets, whether k6 runs in a CI system, the build origin, and the invoked extension&amp;rsquo;s entry as described above. The &lt;code&gt;K6_NO_USAGE_REPORT&lt;/code&gt; environment variable and the &lt;code&gt;noUsageReport&lt;/code&gt; configuration file option turn this report off too. The &lt;code&gt;--no-usage-report&lt;/code&gt; flag has no effect here, because &lt;code&gt;k6 x&lt;/code&gt; passes all flags unchanged to the extension.&lt;/p&gt;
&lt;h2 id=&#34;anonymous-installation-id&#34;&gt;Anonymous installation ID&lt;/h2&gt;
&lt;p&gt;Starting with k6 v2.3.0, usage reports include a random UUID to help estimate the number of active k6 installations over time. Reusing the ID lets Grafana distinguish repeated runs from the same installation from runs across many installations, which helps guide k6 development. The ID is randomly generated, not derived from a username, hostname, or machine fingerprint.&lt;/p&gt;
&lt;p&gt;k6 saves the ID in an &lt;code&gt;installation-id&lt;/code&gt; file and reuses it between runs:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Operating system&lt;/th&gt;
              &lt;th&gt;File location&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Linux and other Unix systems&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$XDG_CONFIG_HOME/k6/installation-id&lt;/code&gt;, or &lt;code&gt;$HOME/.config/k6/installation-id&lt;/code&gt; if &lt;code&gt;XDG_CONFIG_HOME&lt;/code&gt; is unset or empty.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;macOS&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$HOME/Library/Application Support/k6/installation-id&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Windows&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;%AppData%/k6/installation-id&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Setting a custom configuration file with &lt;code&gt;--config&lt;/code&gt; does not change this location. If you delete the ID file, k6 creates a new ID the next time it sends a usage report. This resets the local identifier; it does not disable reporting or delete reports already sent. If k6 cannot read or save the ID, it sends the report without the ID.&lt;/p&gt;
&lt;p&gt;When you disable usage reporting, k6 does not read or create the ID file and sends no report. For example:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;k6 run --no-usage-report script.js&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For extension subcommands, set &lt;code&gt;K6_NO_USAGE_REPORT=true&lt;/code&gt; instead of passing &lt;code&gt;--no-usage-report&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This report is sent to an HTTPS server that collects statistics on k6 usage.&lt;/p&gt;
&lt;p&gt;k6 is an open-source project and for those interested, the actual code that generates and sends the usage report can be directly reviewed &lt;a href=&#34;https://github.com/grafana/k6/blob/master/internal/cmd/report.go&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="usage-collection">Usage collection&lt;/h1>
&lt;p>By default, k6 sends an anonymous usage report each time it is run, so that we can track relevant information to be able to build the product making better data-driven decisions. Prioritizing the features that benefit the most and reducing the impact of changes.&lt;/p></description></item></channel></rss>