Rate Limit

SwiftStack Controller enables the Rate Limit middleware by default on all Swift versions.

Rate limiting is performed on requests that result in database writes to the account and container sqlite dbs. It uses memcached and is dependent on the proxy servers having highly synchronized time. The rate limits are limited by the accuracy of the proxy server clocks.

Configuration

Click on the Rate Limit link on the Manage Cluster page Middleware tab to enable and configure the Rate Limit middleware.

../../_images/rate-limit.png

account_ratelimit

If set, will limit PUT and DELETE requests to /account_name/container_name. Number is in requests per second.

clock_accuracy

Represents how accurate the proxy servers’ system clocks are with each other. 1000 means that all the proxies’ clock are accurate to each other within 1 millisecond. No ratelimit should be higher than the clock accuracy.

max_sleep_time_seconds

App will immediately return a 498 response if the necessary sleep time ever exceeds the given max_sleep_time_seconds.

log_sleep_time_seconds

To allow visibility into rate limiting set this value > 0 and all sleeps greater than the number will be logged.

rate_buffer_seconds

Number of seconds the rate counter can drop and be allowed to catch up (at a faster than listed rate). A larger number will result in larger spikes in rate but better average accuracy.

account_whitelist

Comma separated lists of account names that will not be rate limited.

account_blacklist

Comma separated lists of account names that will not be allowed. Returns a 497 response.