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.
Instalación lista para agent
Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.
npx -y tokrepo@latest install 729c7c2c-38d7-11f1-9bc6-00163e2b0d79 --target codexEjecutar después de confirmar el plan con dry-run.
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.
Preguntas frecuentes
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.
Referencias (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
Relacionados en TokRepo
Discusión
Activos relacionados
Vegeta — HTTP Load Testing Tool at Constant Request Rates
Fast Go HTTP load generator that sustains a precise constant request rate and emits HDR histograms, JSON reports, and latency plots.
k6 — Modern Load Testing Tool Using Go and JavaScript
k6 is a modern load testing tool built by Grafana Labs. Write test scripts in JavaScript, run them in a high-performance Go runtime. Developer-centric with CLI-first workflow, CI/CD integration, and Grafana Cloud for result analysis.
Ddosify — High-Performance Load Testing and Observability Platform
Ddosify is a high-performance load testing tool written in Go that supports HTTP, HTTPS, HTTP/2, gRPC, and GraphQL protocols, with scenario-based testing and distributed execution.
Locust — Scalable Load Testing in Pure Python
Locust is an open-source load testing tool where you define user behavior in plain Python code. Distributed, scalable, and with a real-time web UI for monitoring. No DSL to learn — just write Python.