how many HTTP requests are allowed in a specified time period
how the HTTP service responds when the limit is reached
how many TCP connections are allowed in a specified time period
The policy is applied per service instance. This means that if a service backend has 3 instances rate limited to 100 requests per second, the overall service rate limit is 300 requests per second.
Rate limiting supports an ExternalService only when ZoneEgress is enabled.
Configuration
The MeshRateLimit policy supports both L4/TCP and L7/HTTP limiting. Envoy implements Token Bucket algorithm for rate limiting.
HTTP Rate limiting
disabled - (optional) - should rate limiting policy be disabled
requestRate - configuration of the number of requests in the specific time window
num - the number of requests to limit
interval - the interval for which requests will be limited
onRateLimit (optional) - actions to take on RateLimit event
status (optional) - the status code to return, defaults to 429
headers - (optional) headers which should be added to every rate limited response
Headers
set - (optional) - list of headers to set. Overrides value if the header exists.
name - header’s name
value - header’s value
add - (optional) - list of headers to add. Appends value if the header exists.
name - header’s name
value - header’s value
TCP Rate limiting
TCP rate limiting allows the configuration of a number of connections in the specific time window
disabled - (optional) - should rate limiting policy be disabled
connectionRate - configuration of the number of connections in the specific time window
num - the number of requests to limit
interval - the interval for which connections will be limited
Examples
HTTP Rate limit configured for service backend from all services in the Mesh