Skip to main content

k6 vs Artillery: The Same Test Run in Both Tools

k6 vs Artillery, tested: at 2,000 users Artillery used 4.4 times k6's CPU per request, timed only the first byte, and held its arrival rate through a slowdown.

k6 vs Artillery: The Same Test Run in Both Tools

k6 vs Artillery is a choice between a test written as code and a test written as configuration, and between two load models. k6 runs JavaScript or TypeScript scripts in a single Go binary, with fixed groups of virtual users or a set arrival rate. Artillery runs YAML scenarios on Node.js, and its virtual users arrive at a set rate, run one scenario and leave. Both are free, open source and run from the command line.

To compare them on more than feature lists, we ran the same tests in k6 v2.4.0 and Artillery 2.0.34 against one local API: a shopping journey at 2,000 users, a maximum-rate run, a server slowdown, a run with 5% errors, a streamed response, and an endpoint with a known response-time spread.

Key Takeaways

  • Pick by how tests should be written. Artillery’s YAML scenarios read well to people who do not write code; k6 keeps every test in JavaScript or TypeScript.
  • Artillery is an open model by default. Through a 20-second slowdown to 2-second responses it kept sending 100 requests a second; k6’s arrival-rate executor, with room for 1,000 VUs, managed 92.9 a second and dropped 192 iterations.
  • Artillery’s default response time is time to first byte in whole milliseconds. A 100 kB response that k6 timed at 459.63 ms showed as 0 ms in Artillery until we turned on its extended http.total metric.
  • At 2,000 users both tools finished the journey within a few seconds of the planned 62 from one process, but Artillery used about 4.4 times k6’s CPU per request and about 3 times its memory. An arrivalCount phase runs on one worker thread and stretched the same 62-second journey to 151 and 199 seconds.
  • k6 fails CI with thresholds (exit code 99), Artillery with ensure (1) or expect (21). LoadFocus runs k6 scripts in the cloud, not Artillery scripts.

k6 vs Artillery at a glance

k6 v2.4.0Artillery 2.0.34
LicenceAGPL-3.0, freeMPL-2.0, free
Tests written inJavaScript or TypeScriptYAML, with JavaScript or TypeScript functions; whole tests in TypeScript also work
RuntimeOne Go binary; each virtual user has its own JavaScript runtimeNode.js 22.18.0 or later; local runs split load over worker threads, one fewer than the CPU cores
InstallDownload one binarynpm install -g artillery
Built-in protocolsHTTP/1.1, HTTP/2, WebSocket, gRPC, real browserHTTP, WebSocket, Socket.IO, real browser through Playwright
Load modelClosed (VUs) and open (arrival-rate) executorsOpen: new users arrive per second, each runs one scenario
Response time it reports by defaultFull request time, to a thousandth of a millisecondTime to first byte, in whole milliseconds (http.total with extended metrics)
Pass or fail in CIThresholds, exit code 99 on failureensure checks (exit code 1), expect checks (exit code 21)
Distributed loadk6 Operator on Kubernetes, or Grafana Cloud k6Workers in your own AWS (Lambda, Fargate) or Azure account

Versions, licences and requirements are from each project’s release pages, documentation and the installed packages as of November 2026.

What is the main difference between k6 and Artillery?

The way a test is written and the way users arrive. A k6 test is a JavaScript module whose default function runs in a loop for each virtual user, and you pick an executor that either holds a number of users or starts iterations at a set rate. An Artillery test is a YAML file of phases and scenarios: each phase says how many new users arrive per second, and each user runs its scenario once and leaves.

Both run JavaScript underneath, but in different places. k6 runs your script in its own JavaScript runtime inside a Go program, so it cannot load Node.js packages. Artillery runs on Node.js, so its custom functions can require any npm package, which matters when a test needs a signing library or a client your Node.js services already use. Artillery’s worker threads also mean one Artillery process can use several CPU cores, as one k6 process can.

How do the scripts compare?

The same journey, a login followed by a loop of three requests with one second of think time, takes 25 to 35 lines in each tool. k6 keeps logic and load settings in one JavaScript file; Artillery puts phases and steps in YAML and any logic in a separate JavaScript processor file. Here is the k6 version:

import http from 'k6/http';
import { sleep } from 'k6';

const BASE = 'http://127.0.0.1:8099';
let token; // module scope: each VU keeps its own

export const options = {
  stages: [{ duration: '10s', target: 200 }, { duration: '50s', target: 200 }],
};

export default function () {
  if (!token) {
    const res = http.post(`${BASE}/api/login`, JSON.stringify({ user: `u${__VU}`, password: 'secret' }),
      { headers: { 'Content-Type': 'application/json' } });
    token = res.json('token');
  }
  http.get(`${BASE}/api/items`);
  const id = Math.floor(Math.random() * 50) + 1;
  http.get(`${BASE}/api/items/${id}`, { tags: { name: '/api/items/[id]' } });
  http.post(`${BASE}/api/cart`, JSON.stringify({ id }), {
    headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
  });
  sleep(1);
}

In Artillery, the same test is declarative. Users arrive at 20 a second for 10 seconds, log in once, then loop:

config:
  target: http://127.0.0.1:8099
  phases:
    - duration: 10
      arrivalRate: 20
  plugins:
    metrics-by-endpoint:
      useOnlyRequestNames: true

scenarios:
  - flow:
      - post:
          url: /api/login
          json:
            user: "u{{ $randomNumber(1, 100000) }}"
            password: secret
          capture:
            json: $.token
            as: token
      - loop:
          - get:
              url: /api/items
          - get:
              url: "/api/items/{{ $randomNumber(1, 50) }}"
              name: GET /api/items/[id]
          - post:
              url: /api/cart
              headers:
                Authorization: "Bearer {{ token }}"
              json:
                id: 7
          - think: 1
        count: 50

The YAML reads well to anyone who has not written JavaScript, and a reviewer can see the load shape at a glance. The cost shows when the test needs logic: a branch, a computed value or a custom check means a JavaScript function in a separate processor file, referenced from the YAML. In k6 that logic is just more of the script. Our Artillery tutorial walks through the YAML format, and the k6 scenarios guide covers k6’s options block.

Do k6 and Artillery measure response time the same way?

Not by default. k6’s http_req_duration is the full request: sending, waiting for the server and receiving the body, to a thousandth of a millisecond. Artillery’s http.response_time is time to first byte, the gap between finishing the request and the first byte of the answer, in whole milliseconds. Its documentation says so, and the timer underneath uses Date.now().

For small JSON answers the two are close. For anything with a body that takes time to arrive, they measure different things. We served 100 kB in ten chunks over about 460 ms, with the headers and first chunk sent at once, to 10 users of each tool:

Same 100 kB response, streamed over ~460 msk6Artillery
Reported response time, median459.63 ms (http_req_duration)0 ms (http.response_time)
Time to first byte, median0.34 ms (http_req_waiting)0 ms
Time receiving the body, median459.21 ms (http_req_receiving)not reported

curl agreed with k6: first byte after 5 ms, done after 463 ms. An Artillery threshold on http.response_time would pass this endpoint at any limit, because the slow part happens after the first byte. Artillery can time the whole response, but not by default: with http: { extendedMetrics: true } in config, it also reports http.total, which read 459.5 ms at the median on the same endpoint, still in whole milliseconds. If downloads, large JSON payloads or streamed pages matter to your users, set limits on http.total in Artillery, or on k6’s default http_req_duration.

Artillery stores percentiles in a DDSketch, a compact percentile summary with 1% relative accuracy, which keeps distributed runs cheap to merge. Against an endpoint that waits a random 100 to 400 ms (true 95th percentile 385 ms, true 99th 397 ms), with 100 users for 30 seconds:

100 users, uniform 100 to 400 msk6Artillery
Requests11,94611,868
Median252.33 ms252.2 ms
90th percentile371.94 ms376.2 ms
95th percentile386.52 ms391.6 ms
99th percentile399.02 ms399.5 ms

Artillery’s percentiles land within about 1.3% of k6’s, close to the sketch’s stated 1% accuracy; its whole-millisecond timer adds a little more. For a pass or fail limit in round numbers that is fine. For comparing two runs a few milliseconds apart, compare like with like: Artillery against Artillery, k6 against k6.

How much load can one machine generate?

On our 10-core laptop both tools carried a 2,000-user journey, about 5,800 requests a second at full load, from one process, but k6 used less than a quarter of Artillery’s CPU per request and about a third of its memory. Artillery spreads its users over worker threads, one fewer than the CPU cores; the exception is its arrivalCount phase, which runs on a single worker thread.

We ran the shopping journey above with 2,000 users, twice in each configuration. The full journey needs about 5,800 requests a second; the server answers its slowest endpoint in 25 ms. “Artillery, arrivalCount” is the same script with its phase written as arrivalCount: 2000 over 10 seconds instead of arrivalRate: 200, which starts the same users over the same 10 seconds:

2,000 users, 1 s think time (two runs)k6Artillery, arrivalRateArtillery, arrivalCount
Wall-clock time (journey planned for about 62 s)61.5 s, 61.5 s69.2 s, 65.0 s150.6 s, 199.0 s
Median response time0.52 ms, 0.65 ms7 ms, 1 ms113.3 ms, 518.1 ms
95th percentile26.32 ms, 26.99 ms76 ms, 26.8 ms301.9 ms, 1,249.1 ms
CPU cores used, on average0.52, 0.551.98, 2.040.53, 0.38
CPU time per 1,000 requests0.098 s, 0.104 s0.454 s, 0.440 s0.264 s, 0.253 s
Peak memory661 MB, 658 MB2,134 MB, 1,951 MB684 MB, 575 MB

k6 sent 326,189 and 326,177 requests because its users loop until the duration ends; each Artillery user ran its loop 50 times, 302,000 requests in every run. Artillery’s wall-clock time includes a few seconds of starting Node.js and its workers.

The arrivalCount result is the one to remember. Artillery’s source splits arrivalRate and rampTo phases across its workers, but “arrivalCount is executed in the first worker” and the other workers get a pause instead (lib/dist.ts in 2.0.34). The test-script reference describes arrivalCount without mentioning it. On one thread the journey took 2.4 to 3.2 times as long, and the median rose to 113 and 518 ms for a server that k6, at the same load, measured at under a millisecond. That time was spent inside the load generator. For anything heavier than a few hundred users, write phases with arrivalRate.

With 50 users sending requests with no think time to an endpoint that answers instantly, for 30 seconds, k6 used 0.054 and 0.056 CPU seconds per 1,000 requests across two runs, and Artillery 0.302 and 0.425, five to eight times as much. Artillery’s process also grew to 1,154 and 2,195 MB against 134 and 272 MB for k6. In the less disturbed run, k6 sent 29,643 requests a second on 1.56 cores and Artillery 7,944 on 1.89 cores. Other work on the laptop made absolute rates swing between runs, so read the CPU per request, which held steady, rather than the rates.

How do k6 and Artillery model load?

Artillery is an open model: during a phase it starts a set number of new users every second, whether or not earlier users have finished. k6 offers both open and closed models. Its constant-vus and ramping-vus executors are closed, a fixed number of users each waiting for its response; its constant-arrival-rate executor is open, but it draws from a pool of VUs capped by maxVUs.

The difference shows when the server slows down. We aimed both tools at 100 requests a second, each user or iteration making one request, and made the server’s response time jump from 25 ms to 2 seconds for 20 seconds, counting arrivals on the server:

Target 100 requests a secondBeforeDuring the slowdownAfterWhat the tool recorded
Artillery, no cap100/s100/s100/s6,000 users created, all completed
k6 constant-arrival-rate, up to 1,000 VUs100/s92.9/s100/s192 dropped iterations, 200 VUs at the peak
k6 constant-arrival-rate, up to 100 VUs100/s49.7/s100/s1,010 dropped iterations
Artillery, maxVusers: 100100/s48.7/s100/s1,089 users skipped

With no cap, Artillery kept sending 100 requests a second straight through the slowdown, which is what a real crowd does to a slow server. k6, given room for 1,000 VUs but only 10 pre-allocated, lost 192 iterations over the first dozen seconds of the slowdown while it initialised more; set preAllocatedVUs near the number you expect to need. With the same cap of 100 concurrent users, both tools halved their rate, and both said so: k6 in dropped_iterations, Artillery in vusers.skipped.

The open model has a cost: with no cap, a server that stops answering makes Artillery start users until the load generator runs out of memory or connections. Set maxVusers to a ceiling well above the expected concurrency, so the test survives an outage and the skipped count tells you it happened.

How do k6 and Artillery fail a CI build?

Both exit with code 0 when a server returns errors, unless you add a rule. k6 checks thresholds at the end of the run and exits with code 99 when one fails. Artillery has two plugins: ensure checks thresholds and conditions and exits with code 1, and expect checks each response and exits with code 21 when any check fails.

We pointed each tool at an endpoint that returns HTTP 500 for 5% of requests, for 20 seconds:

5% of requests failExit code
k6, no thresholds0 (4.95% failed)
k6, threshold http_req_failed: ['rate<0.01']99 (4.97% failed)
Artillery, no plugins0 (5.34% failed)
Artillery, expect status 200 on the request21 (4.69% failed)
Artillery, ensure condition on the 500 share1 (5.34% failed)

In k6 a threshold is one line in options, on any metric and percentile, and our k6 checks guide shows how checks feed them. Artillery’s closest equivalent is an ensure condition over its counters, and the obvious one has a trap:

config:
  plugins:
    ensure:
      conditions:
        - expression: "http.codes.500 / http.requests < 0.01"

On a clean run this condition fails. With no 500 responses there is no http.codes.500 counter, and Artillery’s docs say a condition on a metric that does not exist fails; our run of 2,000 requests, all answered 200, exited with code 1. Write the condition over a counter that always exists, such as http.codes.200 / http.requests > 0.99, which exited with 0 on the clean endpoint and 1 on the failing one. If your journey also returns 201 or 204, add those counters only when every run produces them, since a missing counter fails the condition again.

Artillery’s exit codes page gives no numbers and mentions only ensure, so a CI script that tests for exactly 1 will miss the expect plugin’s 21.

How do you scale k6 and Artillery beyond one machine?

Artillery distributes from its own command line into your cloud account: run-lambda and run-fargate for AWS and run-aci for Azure Container Instances. It packages the test, starts the workers, merges their results and removes the workers afterwards, and you pay the cloud provider. k6 runs on one machine; spreading one test takes the k6 Operator on Kubernetes or Grafana Cloud k6.

Grafana Cloud k6 has a free tier of 500 virtual user hours a month and usage-based pricing beyond it (grafana.com/pricing, November 2026). Artillery Cloud is a hosted dashboard for Artillery results with its own plans; the load still comes from the machines or cloud accounts you run it on. Our k6 Operator guide shows how the operator splits one test across pods.

When to choose k6 and when to choose Artillery

Choose by who writes the tests and by the load model you need to test. Both report consistent numbers when the load generator has CPU to spare, so the k6 vs Artillery decision rests on language, protocols, measurement and how users should arrive.

Choose k6 when:

  • the team writes JavaScript or TypeScript and wants test logic in the same file as the load settings;
  • you need gRPC or documented HTTP/2 support from the same tool;
  • your limits are on full response time, including the time to download the body, and you want that as the default metric;
  • one machine must produce a high request rate with little CPU and memory;
  • you want closed and open load models in one tool.

Choose Artillery when:

  • tests should be YAML that testers and reviewers can read without writing code;
  • you want users to keep arriving at a set rate by default, as real traffic does;
  • test logic needs npm packages your Node.js services already use;
  • you want HTTP, Socket.IO and Playwright browser tests in one tool;
  • you want to start distributed workers in your own AWS or Azure account from the command line.

For the other pairings, our k6 vs Locust and k6 vs Gatling comparisons ran the same kind of tests, and k6 vs JMeter vs Gatling vs Locust puts four tools side by side.

Running k6 tests in the cloud with LoadFocus

LoadFocus runs uploaded k6 scripts, JMeter scripts and tests built in the browser from 25 cloud regions, with up to 20,000 concurrent virtual users for k6 depending on the plan; on Pro and Enterprise plans a test can split its load across several regions. It does not run Artillery scripts, so an Artillery test moves to LoadFocus by rewriting it in k6.

The Artillery alternative page sets out when staying on Artillery is the better answer. For k6, see k6 load testing in the cloud.

Frequently Asked Questions

Is k6 better than Artillery?

Neither is better overall. k6 is better when one machine must produce a lot of load cheaply, when you need gRPC or documented HTTP/2 support, and when limits should cover the full response time by default, measured to a fraction of a millisecond. Artillery is better when tests should be readable YAML, when users should keep arriving through a slowdown, and when test logic needs npm packages. Both are free and run from the command line.

Is Artillery faster than k6?

No. In our tests in November 2026, Artillery used 4.4 times k6’s CPU per request on a 2,000-user journey and five to eight times as much at maximum rate, while holding three to nine times the memory. Artillery does spread its users over several CPU cores through worker threads, except in phases written as a total user count (arrivalCount), which run on one thread.

Can k6 run Artillery scripts?

No. k6 runs JavaScript or TypeScript test scripts, and Artillery runs YAML scenarios with optional JavaScript functions, so moving a test between them means rewriting it. The requests, think times and pass or fail limits carry over as a design; the files do not.

Does Artillery support TypeScript?

Yes. Artillery’s test script reference shows whole test scripts written in TypeScript, as well as YAML, and custom functions can be written in JavaScript or TypeScript. k6 also runs TypeScript files directly, without a build step.

Is Artillery free?

Yes. The Artillery command-line tool is open source under the Mozilla Public License 2.0 and installs from npm. Distributed runs start workers in your own AWS or Azure account, which the cloud provider bills, and Artillery Cloud, the hosted results dashboard, is a separate service with its own plans.

Sources

  • k6 v2.4.0 release notes and licence (AGPL-3.0): github.com/grafana/k6, release v2.4.0 (12 November 2026) and repository licence, November 2026.
  • k6 executors and arrival-rate options (preAllocatedVUs, maxVUs, dropped_iterations) and thresholds: grafana.com/docs/k6, “Executors”, “Constant arrival rate” and “Thresholds”, November 2026.
  • Grafana Cloud k6 free tier and Pro pricing: grafana.com/pricing, read 20 November 2026.
  • Artillery 2.0.34 package (MPL-2.0, Node.js 22.18.0 or later): registry.npmjs.org/artillery, read 20 November 2026.
  • Artillery http.response_time measured as time to first byte, and http.total with extendedMetrics: artillery.io/docs, “HTTP engine” reference, read 20 November 2026; lib/core/engine_http.ts in Artillery 2.0.34; got 14.6.6 core/utils/timer.js (firstByte = response - upload, Date.now()).
  • Artillery phases (arrivalRate, arrivalCount, maxVusers): artillery.io/docs, “Test script reference”, read 20 November 2026. Worker threads and arrivalCount on one worker: lib/platform/local/index.ts and lib/dist.ts in Artillery 2.0.34.
  • Artillery percentiles (DDSketch, relative accuracy 0.01): lib/core/ssms.ts in Artillery 2.0.34.
  • Artillery ensure and expect plugins and exit codes: artillery.io/docs, “ensure” and “Expectations and Assertions”, read 20 November 2026; exit code 21 in artillery-plugin-expect, bundled in Artillery 2.0.34.
  • Artillery distributed tests: artillery.io/docs, “Distributed load testing”, November 2026.
  • LoadFocus k6 cloud runs, regions and virtual user limits: loadfocus.com/k6-load-testing and loadfocus.com/index.md; LoadFocus on Artillery: loadfocus.com/alternatives/artillery-alternative, read 20 November 2026.
  • Test runs: k6 v2.4.0 (macOS arm64 binary) and Artillery 2.0.34 on Node.js 23.11.1, against a local Node.js test API (four worker processes; one process for the slowdown test, which counted arrivals per second itself) on an Apple M1 Max with 10 cores, 20 November 2026. CPU and memory from /usr/bin/time -l for the whole tool process. The laptop carried other sessions’ work during the runs (load average from 8 to over 200): the 2,000-user runs started at load averages of 8 to 33, while the maximum-rate runs were disturbed enough that only CPU time per request is compared. Timings show patterns, not benchmarks.

Bogdan

Founder at LoadFocus

Bogdan builds and runs the tools this blog is about. He writes from what the products actually do in production, including the parts that break.

Weekly tips right in your inbox.

Don’t miss out on the latest testing tips and tricks, tools and news related to software testing.

Already +20,000 members in the list.

The Load Testing Platform with AI That Explains Your Results

Load test websites and APIs from 25 cloud regions, monitor page speed and uptime, and get AI analysis that explains your results in plain English.

Cloud load testing, website speed and API monitoring in one place.

Hi there! Can I share a cool thing I'm working on with you?

A software testing newsletter that sparks joy.

Our goal is to create helpful content for software developers and testers.

If you're not into it, you can unsubscribe instantly.