How do I implement QPS-based throttling?

更新时间:
复制 MD 格式

Function Compute does not support QPS-based throttling. To enforce a per-second request rate limit, place a throttling layer in front of your functions using one of the following options.

Choose an approach

ApproachBest for
API GatewayEnforcing QPS limits on API-based function triggers with IP access control
Web Application Firewall (WAF)Blocking high-volume or malicious traffic at the network edge, including IP-based rate limiting and CC attack protection
Lightweight server or ECS instanceCustom throttling logic that neither API Gateway nor WAF covers, using open-source software such as 1panel

API Gateway

Use the IP address-based access control plug-in to restrict request rates per client. See IP address-based access control plug-in for configuration details.

WAF

Use WAF protection rules to throttle or block traffic based on IP address, request frequency, and other conditions.

Lightweight server or ECS

If you need fully custom throttling logic, deploy open-source rate-limiting software on a lightweight server or an Elastic Compute Service (ECS) instance.