Buffering
You can set buffering limits on different Gloo Gateway resources to help fine-tune connection read and write speeds.
Gateway listener
You can set buffer limits and other connection options with the ListenerOptions settings for a Gateway.
The listener options that you set on the Gateway apply to all routes that the Gateway serves.
apiVersion: gateway.solo.io/v1
kind: Gateway
metadata: # collapsed for brevity
spec:
bindAddress: '::'
bindPort: 8080
options:
perConnectionBufferLimitBytes: 10485760
status: # collapsed for brevity
You can configure a maximum payload size on a gateway (perConnectionBufferLimitBytes
) or on a route (perRequestBufferLimitBytes
). The smaller size takes precedence. For example, if a gateway sets the maximum payload size to 10MB and the route to 15MB, the gateway maximum size is enforced. However, if the route size is only 5MB (less than the gateway), then the route maximum size is enforced. To configure different maximum payload sizes for specific workloads, set a larger size on the gateway. Then, set smaller sizes for each workload’s route. Routes that do not specify a maximum payload size inherit the payload size from the gateway.
Route
You can set buffer limits and other connection options with the Buffer settings in the options of a Route in a RouteTable.
apiVersion: gateway.solo.io/v1
kind: RouteTable
metadata:
name: 'petstore'
namespace: 'default'
spec:
routes:
- matchers:
- prefix: '/api/pets'
routeAction:
single:
upstream:
name: default-petstore-8080
namespace: gloo-system
options:
prefixRewrite: '/'
bufferPerRoute:
buffer:
maxRequestBytes: 10485760
Upstream
You can set buffer limits and other connection options with the ConnectionConfig settings for an Upstream.
apiVersion: gloo.solo.io/v1
kind: Upstream
metadata: # collapsed for brevity
spec:
connectionConfig:
maxRequestsPerConnection: 0
perConnectionBufferLimitBytes: 10485760
status: # collapsed for brevity