Skip to content
If you are interested in trying out Gloo Gateway with the Kubernetes Gateway API, check out Solo Enterprise for kgateway. This version adds enterprise functionality on top of the kgateway open source project.

Buffering

Page as Markdown

Fine-tune connection speeds for read and write operations.

About read and write buffer limits

By default, Gloo Gateway is set up with 1MiB of request read and write buffer for each gateway listener. For large requests that must be buffered and that exceed the default buffer limit, Gloo Gateway either disconnects the connection to the downstream service if headers were already sent, or returns a 500 HTTP response code. To make sure that large requests can be sent and received, you can specify the maximum number of bytes that can be buffered between the gateway and the downstream service.

Before you begin

  1. Get the external address of the gateway and save it in an environment variable.

    export INGRESS_GW_ADDRESS=$(kubectl get svc -n gloo-system gloo-proxy-http -o jsonpath="{.status.loadBalancer.ingress[0]['hostname','ip']}")
    echo $INGRESS_GW_ADDRESS  
    kubectl port-forward deployment/gloo-proxy-http -n gloo-system 8080:8080

Set up connection buffer limits

  1. Create a ListenerOption resource to define your connection buffer limit rules.

    kubectl apply -f- <<EOF
    apiVersion: gateway.solo.io/v1
    kind: ListenerOption
    metadata:
      name: bufferlimits
      namespace: gloo-system
    spec:
      targetRefs:
      - group: gateway.networking.k8s.io
        kind: Gateway
        name: http
      options:
        perConnectionBufferLimitBytes: 10485760
    EOF
  2. Verify that your configuration is applied by reviewing the Envoy configuration.

    1. Port forward the gloo-gateway-http deployment on port 19000.
      kubectl port-forward deploy/gloo-proxy-http -n gloo-system 19000 & 
    2. Open the config_dump endpoint.
      open http://localhost:19000/config_dump
    3. Look for the perConnectionBufferLimitBytes: 10485760 string in your Envoy configuration.

Cleanup

You can remove the resources that you created in this guide.

kubectl delete listeneroption bufferlimits -n gloo-system