snet-daemon
uses the Token Bucket Algorithm
and the rate library.
###rate limiting configuration
-
rate_limit_per_minute (optional; default:
Infinity
) Defines the the rate r at which the bucket is filled with tokesn per minute. By default this parameter is set to infinity, effectively having no rate limiting. -
burst_size (optional; default:
Infinity
) - Defines a "token bucket" of size b , with a maximum burst size of b events. The Burst size is ignored when the rate limit is infinity. Please note that the Burst size is ignored when the rate limit is infinity.
The below is an example on how rate limiting could be defined
{
"burst_size": 80000,
"rate_limit_per_minute": 50000
}
For example if rate_limit_per_minute=1 and burst_size=1 => one request is served per minute if rate_limit_per_minute=0.5 and burst_size=1 => one request is served in every 2 minutes