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. Follow the Get started guide to install Gloo Gateway, set up a gateway resource, and deploy the httpbin sample app.

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

Set up connection buffer limits

  1. Create a ListenerOption resource to define your connection buffer limit rules. The following example writes access logs to the stdout stream of the ingress gateway container. Because no custom string format is defined, the default Envoy format is used.

      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