Load Testing

Benchmark APIs with locust ramp up concurrency and breakpoints

LoopyLuci Updated 1 repo stars

File contents

Load Testing

Locust

# locustfile.py
from locust import HttpUser, task

class MyUser(HttpUser):
    @task
    def index(self):
        self.client.get("/")

Run

pip install locust
locust -f locustfile.py --host=http://localhost:8000
# Open http://localhost:8089

Key Metrics

  • RPS (requests per second)
  • P50/P95/P99 latency
  • Error rate
  • Concurrent users

LoopyLuci/Skills/tree/main/skills/load-testing commit b593a9e2d7

Frequently asked questions

npx skillmds@latest add loopyluci/load-testing