Back to Traefik

Traefik InFlightConn Middleware - TCP

docs/content/reference/routing-configuration/tcp/middlewares/inflightconn.md

3.7.0-ea.31.3 KB
Original Source

To proactively prevent Services from being overwhelmed with high load, the number of allowed simultaneous connections by IP can be limited with the inFlightConn TCP middleware.

Configuration Examples

yaml
# Limiting to 10 simultaneous connections
tcp:
  middlewares:
    test-inflightconn:
      inFlightConn:
        amount: 10
toml
# Limiting to 10 simultaneous connections
[tcp.middlewares]
  [tcp.middlewares.test-inflightconn.inFlightConn]
    amount = 10
yaml
labels:
  - "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
json
// Limiting to 10 simultaneous connections
{
  //..
  "Tags" : [
    "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"
  ]
}
yaml
apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
  name: test-inflightconn
spec:
  inFlightConn:
    amount: 10

Configuration Options

FieldDescriptionDefaultRequired
<a id="opt-amount" href="#opt-amount" title="#opt-amount">amount</a>The amount option defines the maximum amount of allowed simultaneous connections.
The middleware closes the connection if there are already amount connections opened.""Yes