Skip to content

Instantly share code, notes, and snippets.

@omerkaya1
Last active November 19, 2024 16:22
Show Gist options
  • Save omerkaya1/bc79de8d21c8e02bdc2f1c071c5185f9 to your computer and use it in GitHub Desktop.
Save omerkaya1/bc79de8d21c8e02bdc2f1c071c5185f9 to your computer and use it in GitHub Desktop.
Artillery config file (load testing WebSocket)
config:
environments:
local:
target: "http://localhost:8080"
phases:
- duration: 60
arrivalRate: 300 # Start with 50 virtual users per second
rampTo: 5000 # Gradually increase to 100 users per second
http:
extendedMetrics: true
scenarios:
- name: "Basic Scenario"
flow:
- put:
url: "/some"
headers:
Content-Type: "application/json"
Accept: "*/*"
X-Request-ID: "1"
X-Forwarded-For: "1.1.1.1"
X-Real-IP: "1.1.1.1"
X-Client-IP: "1.1.1.1"
X-Client-Port: "1"
User-Agent: "Artillery"
config:
environments:
local:
target: "http://localhost:8000"
phases:
- duration: 10
arrivalRate: 1
arrivalCount: 200
maxVusers: 50
name: "Warm up"
- duration: 20
arrivalRate: 3
arrivalCount: 500
maxVusers: 100
name: "Medium load"
- duration: 30
arrivalRate: 5
arrivalCount: 1500
maxVusers: 200
name: "Max load"
scenarios:
- engine: ws
name: Opened session for a single user
flow:
- connect: "{{ target }}/ws"
- send: '{"id": 160, "type": "GetServerTime"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment