Rate Limiting

server/rate_limiting

Specifies the global configuration related to rate limiting. Rate limiting policies are defined using the policies/rate_limiting[] entry.

Properties

NameTypeConstraintsDescription
cache_sizenumberMinimum: 1

Maximum: unlimited

Default value: 16384
The number of unique records to cache locally for the rate limiting capability. When this cache is exhausted, the oldest cached records are ejected. This effectively resets the rate limiting counters for this client(s). This number needs to be higher than the number of requests being rate limited across a refresh interval.
redisredis

server/rate_limiting/redis

These entries control whether or not rate limiting data will be stored in a Redis database. When stored in a Redis database, rate limiting data can be shared across multiple gateway instances.

Properties

NameTypeConstraintsDescription
collection_namestringSpecify the name of a Redis collection which will be used for maintaining rate limiting data. Redis collections are defined using the services/redis[] entry.
sync_windownumberMinimum: 0

Maximum: unlimited

Default value: 5
The length of time (in seconds) a record from Redis will be cached locally by this instance. Records will only be synchronized with Redis after this window has elapsed.

Example

rate_limiting:
  cache_size: 16384
  redis:
    collection_name: test-collection
    sync_window: 10

Did this page help you?