Skip to content

Rate limiting

Rate limiting is per-app, configured with simpledeploy.ratelimit.* labels on any service in the compose file.

LabelDefaultDescription
simpledeploy.ratelimit.requests200 (server config)Allowed requests per window
simpledeploy.ratelimit.window60sLength of the window
simpledeploy.ratelimit.burst50Extra short-spike allowance over the steady rate
simpledeploy.ratelimit.byipKey to bucket by: ip, header:NAME, or path

requests/window define the steady rate. burst lets a client briefly exceed it before getting throttled. Once the bucket is empty, clients get 429 Too Many Requests with a Retry-After: 60 header.

services:
web:
image: myapp:latest
labels:
simpledeploy.endpoints.0.domain: "myapp.example.com"
simpledeploy.endpoints.0.port: "3000"
simpledeploy.ratelimit.requests: "100"
simpledeploy.ratelimit.window: "60s"
simpledeploy.ratelimit.burst: "20"
simpledeploy.ratelimit.by: "ip"

100 req/min/IP, with burst up to 120.

labels:
simpledeploy.ratelimit.requests: "1000"
simpledeploy.ratelimit.window: "60s"
simpledeploy.ratelimit.by: "header:X-API-Key"

Each unique X-API-Key value gets its own bucket. Requests with no header share one bucket.

labels:
simpledeploy.ratelimit.requests: "10"
simpledeploy.ratelimit.window: "10s"
simpledeploy.ratelimit.by: "path"

Useful for hot endpoints like /login or /search where you want to keep one path from starving others.

For admin or internal-only paths, put the app behind an IP allowlist with IP access control and skip rate limiting entirely.

See also: Compose labels, Configuration.