InFlightConn
Limiting the Number of Simultaneous connections.
To proactively prevent services from being overwhelmed with high load, the number of allowed simultaneous connections by IP can be limited.
Configuration Examples
Docker
labels:
- "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
Kubernetes
apiVersion: traefik.containo.us/v1alpha1
kind: MiddlewareTCP
metadata:
name: test-inflightconn
spec:
inFlightConn:
amount: 10
Consul Catalog
# Limiting to 10 simultaneous connections
- "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
Marathon
"labels": {
"traefik.tcp.middlewares.test-inflightconn.inflightconn.amount": "10"
}
Rancher
# Limiting to 10 simultaneous connections.
labels:
- "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
File (YAML)
# Limiting to 10 simultaneous connections.
tcp:
middlewares:
test-inflightconn:
inFlightConn:
amount: 10
File (TOML)
# Limiting to 10 simultaneous connections
[tcp.middlewares]
[tcp.middlewares.test-inflightconn.inFlightConn]
amount = 10
Configuration Options
amount
The amount
option defines the maximum amount of allowed simultaneous connections. The middleware closes the connection if there are already amount
connections opened.