Artillery — Modern Load Testing for HTTP, WebSocket & More
Node.js load testing toolkit with YAML scenarios covering HTTP, WebSocket, gRPC and Playwright, plus distributed runs on AWS Fargate.
What it is
Artillery is a Node.js load testing toolkit that uses YAML scenario files to define test configurations. It supports HTTP, WebSocket, gRPC, and browser-based testing via Playwright. Artillery handles both quick smoke tests from the command line and complex multi-step scenarios with variable injection, response capture, and conditional logic.
Artillery targets backend developers, QA engineers, and SRE teams who need to verify application performance under load. It scales from local single-machine tests to distributed runs on AWS Fargate for production-level load generation.
How it saves time or tokens
Artillery's YAML-based approach means you write test scenarios declaratively rather than programming test scripts. A few lines of YAML define ramp-up patterns, request sequences, and success criteria. The built-in reporting shows latency percentiles, error rates, and throughput. Distributed mode on AWS Fargate generates load from multiple regions without managing infrastructure.
How to use
- Install Artillery:
npm install -g artillery. - Run a quick smoke test:
artillery quick --count 100 --num 5 https://api.example.com/health. - Create a YAML scenario file for complex test patterns and run with
artillery run load.yml.
Example
# load.yml
config:
target: 'https://api.example.com'
phases:
- duration: 60
arrivalRate: 10
name: 'Warm up'
- duration: 120
arrivalRate: 50
name: 'Sustained load'
- duration: 60
arrivalRate: 100
name: 'Peak load'
scenarios:
- name: 'API workflow'
flow:
- get:
url: '/api/items'
expect:
- statusCode: 200
- post:
url: '/api/items'
json:
name: 'test-item'
capture:
json: '$.id'
as: 'itemId'
- get:
url: '/api/items/{{ itemId }}'
# Run the test
artillery run load.yml
# Quick smoke test
artillery quick --count 100 --num 5 https://api.example.com/health
Related on TokRepo
- Testing Tools — Testing frameworks and tools
- DevOps Tools — Infrastructure and performance tools
Common pitfalls
- Local machine network and CPU limits constrain load generation. For tests above a few hundred requests per second, use distributed mode on AWS Fargate.
- YAML scenario syntax is specific to Artillery. Do not confuse it with other load testing tools' configuration formats.
- Response time measurements include network latency from the load generator. When testing locally against a remote server, network conditions affect results.
Frequently Asked Questions
Artillery uses YAML for test definition while k6 uses JavaScript. Artillery has built-in distributed execution on AWS Fargate; k6 has k6 Cloud. Both support HTTP, WebSocket, and gRPC. Artillery is simpler for basic tests; k6 offers more scripting flexibility.
Yes. Artillery has built-in WebSocket support. You define WebSocket scenarios in YAML with connect, send, and expect steps. It measures connection time, message latency, and throughput.
Yes, through the Playwright engine. You can write browser-based scenarios that navigate pages, fill forms, and assert on page content under load. This tests the full user experience, not just API endpoints.
Artillery Cloud and the Fargate integration distribute load generation across multiple machines. You run artillery run --platform aws:fargate load.yml to spin up workers that generate load from AWS infrastructure.
Artillery reports request count, response time percentiles (p50, p95, p99), error rates, throughput (requests/second), and HTTP status code distribution. Reports can be exported as JSON or HTML.
Citations (3)
- Artillery GitHub— Artillery provides YAML-based load testing for HTTP, WebSocket, and gRPC
- Artillery Documentation— Artillery scenario configuration and distributed testing
- Artillery Official Site— Load testing methodology and performance benchmarking
Related on TokRepo
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.