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
| Approach | Best for |
|---|---|
| API Gateway | Enforcing 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 instance | Custom 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.
Enable WAF protection — set up WAF for Function Compute
Protection rules — configure rate-limiting and access control rules in WAF 3.0
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.
该文章对您有帮助吗?