Skip to main content

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.

✓ YAML scenarios ✓ HTTP, WS, gRPC ✓ Ramp-up phases ✓ Built-in assertions ✓ CI/CD ready ✓ Open source

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

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 definitionYAML (no code needed)JavaScript / TypeScript
Protocol supportHTTP, WS, Socket.io, gRPC, KinesisHTTP, WebSockets, gRPC
Runtime dependencyNode.js requiredSingle binary, no dependency
Grafana integrationVia pluginFirst-class (k6 → Grafana)
Assertions / checksYAML expect pluginJS checks() API
Cloud / distributedArtillery 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.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

YAML Validator Pro YAML to JSON Converter YAML Diff Viewer JSON ↔ YAML Converter YAML Validator & Formatter YAML to TOML Converter Web Performance Checklist Helm Values Generator YAML to TOML Converter Jest Testing Framework Guide Kubernetes Manifest Generator GitHub Actions YAML Linter Kubernetes YAML Validator Helm Chart Linter CI/CD Pipeline Generator k6 Load Test Script Generator Lighthouse Score Simulator Vitest Guide — Vite-native Testing Cypress Frontend Testing Guide Pulumi Stack Config Generator Helm Values Validator Web Vitals Budget Planner Helm Chart Values Generator Core Web Vitals Guide AI Unit Test Generator — Pro Tool API Response Mock Generator HTTP API Tester Docker Compose Generator GitHub Actions Workflow Generator Web Vitals Scorer OpenAPI Validator SQL Index Advisor ArgoCD App Health Checker OpenTelemetry Config Generator Prometheus Alert Rules Validator HAR Diff Analyzer Kubernetes Resource Quota Calculator MySQL Query Explainer GitHub Actions Workflow Validator PostgreSQL EXPLAIN Analyzer OpenAPI Schema Validator pnpm Workspace Generator K8s Resource Limits Calculator HTTP/2 Server Push Headers Builder Playwright E2E Test Generator Ansible Playbook Builder Web Vitals Analyzer Database Index Analyzer Helm Values Builder Playwright E2E Testing Guide Core Web Vitals Calculator Database Index Advisor Ansible Playbook Linter ArgoCD Application Generator GitHub Actions Matrix Builder Kubernetes Resource Request Calculator GitHub Actions Cron Builder LLM Benchmark Calculator Prompt Injection Tester CrewAI Agent Config Generator k6 Script Generator Kubernetes RBAC Builder API Test Case Generator Core Web Vitals Budget Calculator Bundle Size Budget Calculator Image Optimization Calculator TTFB Analyzer Database Query Cost Analyzer

Related Articles

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$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.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →