Help Center/ Cloud Container Engine/ User Guide/ Networking/ Gateway API/ Using Envoy Gateway for Performance Tuning
Updated on 2026-06-05 GMT+08:00

Using Envoy Gateway for Performance Tuning

Envoy Gateway is a high-performance gateway, but its default configuration is not optimized for production workloads. To realize its full performance potential in high-concurrency environments, you must tune key parameters. This section describes how to create a BackendTrafficPolicy to configure these circuit breaker parameters for demanding service scenarios.

Prerequisites

A Gateway and an HTTPRoute are already running in your cluster.

Parameter Tuning

  • Increasing maxConnections

    The maxConnections parameter defines the maximum number of HTTP/1.1 or TCP connections that Envoy can establish with upstream targets. Once this limit is reached, Envoy rejects any additional connection attempts. The default value is 1024, which is typically sufficient for moderate traffic loads. In high-concurrency scenarios, increase this value to 65536.

  • Increasing maxPendingRequests

    The maxPendingRequests parameter controls the maximum number of requests that may wait in the queue when no connection is available or the connection pool has reached capacity. Requests that exceed this threshold are rejected. The default value is 1024. In high-concurrency scenarios, a queue of this size may overflow, causing connection establishment failures. To prevent this, set maxPendingRequests to 65536.

  • Increasing maxParallelRequests

    The maxParallelRequests parameter specifies the maximum number of concurrent requests that can be processed across all upstream connections. This limit applies to both HTTP/1.1 and HTTP/2 routes. When the number of concurrent requests exceeds this value, new requests immediately trigger the circuit breaker. The default value is 1024. In high-concurrency scenarios, increase this value to 65536.

Configuration Example

  1. Create a BackendTrafficPolicy resource and associate it with the target Gateway or HTTPRoute.

    Example:

    apiVersion: gateway.envoyproxy.io/v1alpha1
    kind: BackendTrafficPolicy
    metadata:
      name: backend-cb
      namespace: default
    spec:
      targetRefs:
      - group: gateway.networking.k8s.io
        kind: Gateway                    # Gateway or HTTPRoute
        name: my-gateway          # Gateway or HTTPRoute name
      circuitBreaker:
        maxConnections: 65536    # Maximum connections to the backend
        maxPendingRequests: 65536    # Maximum number of requests that can wait in the queue when no connection is available
        maxParallelRequests: 65536    # Maximum concurrent requests
        maxParallelRetries: 3    # Maximum number of retries that can be executed concurrently for a single request

  2. Check the BackendTrafficPolicy status.

    kubectl get BackendTrafficPolicy backend-cb -oyaml
    Information similar to the following is displayed:
    apiVersion: gateway.envoyproxy.io/v1alpha1
    kind: BackendTrafficPolicy
    metadata:
      creationTimestamp: "2026-05-30T09:00:47Z"
      generation: 1
      name: backend-cb
      namespace: default
      resourceVersion: "9674343"
      uid: 43eecacb-5974-49d6-bc6e-1419b0d23496
    spec:
      circuitBreaker:
        maxConnections: 65536
        maxParallelRequests: 65536
        maxParallelRetries: 3
        maxPendingRequests: 65536
      targetRefs:
      - group: gateway.networking.k8s.io
        kind: Gateway
        name: my-gateway
    status:
      ancestors:
      - ancestorRef:
          group: gateway.networking.k8s.io
          kind: Gateway
          name: my-gateway
          namespace: default
        conditions:
        - lastTransitionTime: "2026-05-30T09:00:47Z"
          message: Policy has been accepted.
          observedGeneration: 1
          reason: Accepted
          status: "True"    # Accepted: True (accepted)
          type: Accepted
        controllerName: gateway.envoyproxy.io/gatewayclass-controller