mirror of
https://github.com/traefik/traefik.git
synced 2025-10-25 06:21:38 +02:00
1.4 KiB
1.4 KiB
MaxConnection
Limiting the Number of Simultaneous Clients {: .subtitle }
To proactively prevent services from being overwhelmed with high load, a maximum connection limit can be applied.
Configuration Examples
# Limiting to 10 simultaneous connections
labels:
- "traefik.http.middlewares.test-maxconn.maxconn.amount=10"
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: addprefix
spec:
addPrefix:
prefix: /bar
# Limiting to 10 simultaneous connections
labels:
- "traefik.http.middlewares.test-maxconn.maxconn.amount=10"
# Limiting to 10 simultaneous connections
[http.middlewares]
[http.middlewares.test-maxconn.maxconn]
amount = 10
Configuration Options
amount
The amount option defines the maximum amount of allowed simultaneous connections.
The middleware will return an HTTP 429 Too Many Requests if there are already amount requests in progress (based on the same extractorfunc strategy).
extractorfunc
The extractorfunc defines the strategy used to categorize requests.
The possible values are:
request.hostcategorizes requests based on the request host.client.ipcategorizes requests based on the client ip.request.header.ANY_HEADERcategorizes requests based on the providedANY_HEADERvalue.
