Cluster-wide Request Limits

Share request-rate, request-count, and concurrency limits across nodes in a local gateway cluster.

Release status: This feature is currently on a development branch and has not been assigned to a formal OpenResty Edge release. Do not use it in production configuration until a formal release includes it.

By default, each gateway node counts request-rate, request-count, and concurrency limits independently. Share This Limit Across Nodes in the Local Gateway Cluster exchanges counters between nodes so that the allowance more closely represents the whole cluster.

Enable a cluster limit

The switch is available for Limit Request Rate, Limit Request Count, and Limit Request Concurrency. Edit the corresponding action in a page rule, global rewrite rule, or global custom action, enable cluster sharing, and publish the configuration.

Cluster Limit switch in the Limit Request Rate action

Synchronization is asynchronous, so nodes can temporarily observe different counters. This feature does not provide a distributed transaction or an instantaneous hard global ceiling. Leave headroom for synchronization delay and traffic bursts when setting a threshold.

Shared-memory settings

Under Global Config > General > Others for the partition, configure the cluster-limit broadcast and handoff shared-memory sizes. Both default to 8 MB. Insufficient memory can make counter synchronization incomplete, while an oversized value increases memory use on every gateway node.

Before changing the sizes, observe the number of active limit keys and node memory. Publish the related global configuration as directed by the console and confirm that every node in the cluster completes synchronization.