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 & Swarm

  1. labels:
  2. - "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"

Kubernetes

  1. apiVersion: traefik.io/v1alpha1
  2. kind: MiddlewareTCP
  3. metadata:
  4. name: test-inflightconn
  5. spec:
  6. inFlightConn:
  7. amount: 10

Consul Catalog

  1. # Limiting to 10 simultaneous connections
  2. - "traefik.tcp.middlewares.test-inflightconn.inflightconn.amount=10"

File (YAML)

  1. # Limiting to 10 simultaneous connections.
  2. tcp:
  3. middlewares:
  4. test-inflightconn:
  5. inFlightConn:
  6. amount: 10

File (TOML)

  1. # Limiting to 10 simultaneous connections
  2. [tcp.middlewares]
  3. [tcp.middlewares.test-inflightconn.inFlightConn]
  4. 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.