Configure distributed rate limiting
masterDistributed rate limiting allows multiple Caddy instances to share rate limit state across a cluster.
Requirements:
- All instances in the cluster must have the exact same rate limit zone configurations.
- All instances must be configured to use the same storage module.
How it works: Instances periodically write their internal state to storage and read the state from other instances. This synchronization is eventually consistent and approximate.
Configuration:
Enable it by providing a non-null distributed object in JSON or the distributed subdirective in a Caddyfile. You can tune the following parameters:
read_interval: How often to read state from storage.write_interval: How often to write state to storage.purge_age: How long to keep old state.
Note: Default intervals are 5s.