Consul
Limit traffic rates overview
This topic provides overview information about the traffic rates limits you can configure for Consul servers.
Introduction
You can configure global RPC rate limits to mitigate the risks to Consul servers when clients send excessive read or write requests to Consul resources. A read request is defined as any request that does not modify Consul internal state. A write request is defined as any request that modifies Consul internal state. Read and write requests are limited separately.
Rate limit modes
You can set one of the following modes, which determine how Consul servers react when the request limits are exceeded.
- Enforcing mode: In this mode, the rate limiter denies requests to a server beyond a configurable rate. Consul generates metrics and logs to help operators understand their Consul load and configure limits accordingly.
- Permissive mode: The rate limiter allows requests if the limits are reached and produces metrics and logs to help operators understand their Consul load and configure limits accordingly. This mode is intended to help you configure limits and debug specific issues.
- Disabled mode: Disables the rate limiter. All requests are allowed and no logs or metrics are produced. This is the default mode.
Refer to rate_limits
for additional configuration information.
Request denials
When an HTTP request is denied for rate limiting reason, Consul returns one of the following errors:
429 Resource Exhausted: Indicates that a server is not able to perform the request but that another server could potentially fulfill it. This error is most common on stale reads because any server may fulfill state read requests. To resolve this type of error, we recommend immediately retrying the request to another server. If the request came from a Consul client agent, the agent automatically retries the request up to the limit set in the
rpc_hold_timeout
configuration .503 Service Unavailable: Indicates that server is unable to perform the request and that no other server can fulfill the request, either. This usually occurs on consistent reads or for writes. In this case we recommend retrying according to an exponential backoff schedule. If the request came from a Consul client agent, the agent automatically retries the request according to the
rpc_hold_timeout
configuration.
Refer to Rate limit reached on the server for additional information.