Artillery
Modern, open-source performance and load testing framework. Define realistic traffic scenarios in YAML — ramp-up phases, think times, loops, and assertions — across HTTP, WebSockets, gRPC, and Socket.io. Built for CI/CD integration from day one.
What is Artillery?
Artillery is an open-source performance testing framework designed for modern cloud-native applications. Unlike tools that require writing code to define test logic, Artillery uses a YAML-based configuration format that lets you describe multi-phase load patterns and realistic user scenarios with minimal friction. A basic test can go from zero to running in under five minutes.
Artillery supports multiple protocols — HTTP/HTTPS, WebSockets, Socket.io, gRPC, and Amazon Kinesis — making it suitable for testing APIs, real-time applications, and event-driven services with the same toolchain. Tests integrate directly into GitHub Actions, GitLab CI, Jenkins, and any other CI/CD system that can run an npm script.
Key Features
- YAML-first configuration — define targets, load phases, and user scenarios without writing test code for common cases
- Realistic traffic phases — warm-up, ramp-up, sustained load, and spike phases with configurable arrival rates
- Multi-protocol — HTTP/HTTPS, WebSockets, Socket.io, gRPC (plugin), and Amazon Kinesis
- Think time & loops — simulate realistic user behaviour with pauses, loops, and conditional branching
- Built-in metrics — response time percentiles, error rates, RPS, and virtual user counts reported per phase
- Expect plugin — add assertions (status codes, JSON properties, regex) to fail tests on contract violations
- Variable capture — extract values from responses (e.g. auth tokens) and use them in subsequent requests
- CI/CD integration — exits with code 1 on threshold violations; works with GitHub Actions, GitLab, Jenkins
Installation
# Install globally npm install -g artillery # Or add to a project as a dev dependency npm install --save-dev artillery # Verify installation artillery version # Run a quick smoke test against any URL (no config file needed) artillery quick --count 20 --num 10 https://example.com/api/health
Writing a YAML Scenario
An Artillery config file has two top-level sections: config (target URL, load phases, default headers) and scenarios (user flows with weighted traffic distribution). The example below defines a three-phase load test with a warm-up, ramp-up, and sustained load period.
# load-test.yml — a complete Artillery scenario config
config:
target: "https://api.example.com"
phases:
- duration: 60 # warm-up: 1 minute at 10 RPS
arrivalRate: 10
name: "Warm up"
- duration: 120 # ramp-up: 2 minutes, 10 → 50 RPS
arrivalRate: 10
rampTo: 50
name: "Ramp up"
- duration: 300 # sustained load: 5 minutes at 50 RPS
arrivalRate: 50
name: "Sustained load"
defaults:
headers:
Content-Type: "application/json"
Accept: "application/json"
scenarios:
- name: "Browse and create item"
weight: 7 # 70% of virtual users run this scenario
flow:
- get:
url: "/items"
expect:
- statusCode: 200
- think: 2 # simulate user reading for 2 seconds
- post:
url: "/items"
json:
name: "Test item {{ $randomString() }}"
price: "{{ $randomNumber(1, 100) }}"
expect:
- statusCode: 201
- name: "Health check"
weight: 3 # 30% of virtual users run this scenario
flow:
- get:
url: "/health"
expect:
- statusCode: 200 Running Tests
Use artillery run to execute a test and print a live summary to stdout. Save results with --output and generate an HTML report with artillery report.
# Run a test from a YAML config file
artillery run load-test.yml
# Run and save results to a JSON report file
artillery run load-test.yml --output results.json
# Generate an HTML report from saved results
artillery report results.json
# Run with an environment override (override config.target)
artillery run load-test.yml --target https://staging.example.com
# Run only a specific scenario by name
artillery run load-test.yml --scenario "Browse and create item"
# Run with extra variables passed from the command line
artillery run load-test.yml --variables '{"userId":"abc123"}' Assertions with the Expect Plugin
The @artillery/plugin-expect plugin adds assertion support directly inside YAML flow steps. Capture tokens from login responses and use them in subsequent authenticated requests — all within the same scenario.
# artillery-expect plugin — add assertions to your scenarios
# Install: npm install --save-dev @artillery/plugin-expect
config:
target: "https://api.example.com"
plugins:
expect: {} # enable the expect plugin
phases:
- duration: 30
arrivalRate: 5
scenarios:
- name: "Login and get profile"
flow:
- post:
url: "/auth/login"
json:
email: "[email protected]"
password: "secret"
capture:
- json: "$.token" # capture JWT from response body
as: token
expect:
- statusCode: 200
- hasProperty: "token"
- get:
url: "/users/me"
headers:
Authorization: "Bearer {{ token }}"
expect:
- statusCode: 200
- contentType: json
- hasProperty: "email" Artillery vs k6
| Feature | Artillery | k6 |
|---|---|---|
| Test definition | YAML (no code needed) | JavaScript / TypeScript |
| Protocol support | HTTP, WS, Socket.io, gRPC, Kinesis | HTTP, WebSockets, gRPC |
| Runtime dependency | Node.js required | Single binary, no dependency |
| Grafana integration | Via plugin | First-class (k6 → Grafana) |
| Assertions / checks | YAML expect plugin | JS checks() API |
| Cloud / distributed | Artillery Cloud (paid) | k6 Cloud (paid) |
Pros and Cons
Pros
- ✓ YAML-driven — non-engineers can write and modify tests
- ✓ Realistic scenarios with think time, loops, and weighted flows
- ✓ Multi-protocol: HTTP, WebSockets, Socket.io, gRPC, Kinesis
- ✓ First-class CI/CD integration with exit code 1 on failures
- ✓ Open source core — no SaaS required for most use cases
Cons
- ✗ Requires Node.js — not a single portable binary like k6
- ✗ Complex scripting logic requires JavaScript extensions
- ✗ Distributed load generation requires Artillery Cloud (paid)
- ✗ YAML can become verbose for large multi-scenario test suites
- ✗ HTML reports are basic compared to Grafana k6 dashboards
Frequently Asked Questions
What is Artillery?▼
Artillery is a modern, open-source performance and load testing framework. Tests are defined in YAML (or JavaScript) configuration files that describe target URLs, load phases (ramp-up, sustained, spike), and user scenarios with realistic think times, loops, and conditional logic. Artillery supports HTTP, WebSockets, Socket.io, gRPC, and Amazon Kinesis. It runs on Node.js, installs via npm, and integrates with CI/CD pipelines. Artillery Cloud (the commercial SaaS layer) adds results history, team dashboards, and distributed load generation.
How does Artillery compare to k6?▼
Both are modern load testing tools with strong CI/CD integration. k6 uses JavaScript test scripts (no YAML) and ships as a single compiled binary with no Node.js dependency, making it fast and portable. Artillery uses YAML for test configuration, which requires less code for common scenarios but is less flexible for complex logic. Artillery supports more protocols out of the box (WebSockets, Socket.io, gRPC). k6 has a strong extension ecosystem and excellent Grafana integration. Artillery Cloud and k6 Cloud both offer SaaS dashboards. k6 is often preferred for developer-centric workflows; Artillery is often preferred for teams that want YAML-driven, no-code test definitions.
How do I write scenarios in YAML?▼
Artillery scenarios are defined under the scenarios key in your YAML config. Each scenario has a name, an optional weight (probability of selection), and a flow array of steps. Steps can be HTTP actions (get, post, put, delete), WebSocket actions, think time pauses (think: N seconds), loops, conditionals, and variable captures. Use {{ $randomString() }}, {{ $randomNumber(min, max) }}, and {{ variableName }} for dynamic data. Multiple scenarios with different weights simulate realistic mixed traffic — for example, 70% browsing and 30% submitting forms.
What protocols does Artillery support?▼
Artillery natively supports HTTP/1.1 and HTTPS, WebSockets, Socket.io, and Amazon Kinesis. gRPC support is available via the @artillery/plugin-grpc plugin. The plugin ecosystem extends Artillery further — community plugins exist for MQTT, HLS video streaming, and custom protocols. For HTTP, Artillery handles GET, POST, PUT, PATCH, DELETE, and custom methods with arbitrary headers, request bodies, file uploads, and TLS certificate configuration.
How do I add assertions to Artillery tests?▼
Install the official @artillery/plugin-expect package and enable it with plugins: { expect: {} } in your config. Then add an expect block to any HTTP flow step. Supported assertions include statusCode (exact or range), contentType, hasProperty (checks a JSON response has a given key), matchesRegexp, equals, and custom JavaScript expressions. If an assertion fails, Artillery marks the virtual user's request as an error and increments the assertion failure counter in the results. This is useful for verifying API contracts during load tests, not just measuring throughput.
Is Artillery open source?▼
Yes. The Artillery core engine and CLI are open source under the MPL-2.0 license and the source is available on GitHub. The free version supports running tests locally or on your own infrastructure with all core features including HTTP/WebSocket/gRPC testing, YAML scenarios, and HTML reports. Artillery Cloud is the commercial SaaS product that adds distributed load generation (running tests from multiple geographic regions), results storage and history, team collaboration dashboards, and alerting. Most teams can accomplish full load testing workflows with the open-source version alone.
Related Products
on GumroadPremium Workflow Pack
Production-grade workflows, architecture guides, and deployment scripts for teams that ship. 10 advanced CI/CD workflows (blue-green, canary, E2E, security), 5 architecture deep-dives, code review checklist, PR process guide, and 5 battle-tested Bash deployment scripts.
Buy on Gumroad →GitHub Actions CI/CD Templates Pack
12 production-ready GitHub Actions workflow templates covering Node.js, Python, Docker, multi-environment deployments, security scanning, and auto-changelog. Copy, paste, ship.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
YAML Validator Pro
Advanced YAML validator with line-number error reporting, JSON preview, and schema hints for common YAML pitfalls. Free, runs in your browser.
Open free tool →
YAML to JSON Converter
Convert YAML to JSON and JSON to YAML online. Bidirectional conversion with syntax highlighting, error detection, and formatted output. Supports multi-document YAML and complex nested structures.
Open free tool →
YAML Diff Viewer
Compare two YAML files side-by-side with highlighted differences. Added lines in green, removed in red, changed in yellow. Supports semantic key-level diff. Free, runs in your browser.
Open free tool →
More Free Tools
Related Articles
Performance Testing in 2026: Beyond Page Load Times
A practical guide to performance testing in 2026 — Core Web Vitals, load testing, stress testing, soak testing, and building a performance culture that treats speed as a feature. Includes tooling recommendations and actionable measurement strategies.
Best Load Testing Tools for Developers in 2025: k6, JMeter, Locust, and More
A practical comparison of load testing tools in 2025 — k6, JMeter, Locust, Gatling, and Artillery — covering scripting ease, CI integration, cloud execution, and when each tool fits your testing needs.
GitHub Actions 入門必讀:從 0 到自動化部署
完整的 GitHub Actions 新手教學,從基本概念、workflow 語法到實戰 CI/CD 自動部署。附完整 YAML 範例,30 分鐘學會持續整合。
DevOps Automation Tools in 2026: Orchestrating the Software Delivery Pipeline
Master DevOps automation with this guide to the tools that orchestrate modern software delivery. Covers CI/CD pipelines, infrastructure provisioning, configuration management, testing automation, and the emerging AI-assisted automation patterns that define 2026.
End-to-End Testing in 2026: Writing Tests That Don't Lie
E2E testing guide 2026: choose Playwright or Cypress, eliminate flakiness, structure test suites for CI/CD, and understand real application quality limits.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →