forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
17 KiB
17 KiB
Request Throttling Plug-in
The request throttling plug-in limits the number of times an API can be called within a specific time period. It supports parameter-based, basic, and excluded throttling.

If your gateway does not support the request throttling plug-in, contact customer service to upgrade the gateway.
- Basic throttling
Throttle requests by API, user, app, or source IP address. This function is equivalent to a request throttling policy but is incompatible with it.
- Parameter-based throttling
Throttle requests based on headers, path parameters, methods, query strings, or system variables.
- Excluded throttling
Constraints
- A request throttling policy becomes invalid if a request throttling plug-in is bound to the same API as the policy.
- You can define a maximum of 100 parameter rules.
- The plug-in content cannot exceed 65,535 characters.
Configuration Parameters
Example Script
{ "scope": "basic", "default_interval": 60, "default_time_unit": "second", "api_limit": 100, "app_limit": 50, "user_limit": 50, "ip_limit": 20, "specials": [ { "type": "app", "policies": [ { "key": "2e421d76dc6c4c75941511ccf654e368", "limit": 10 } ] }, { "type": "user", "policies": [ { "key": "878f1b87f71c40a7a15db0998f358bb9", "limit": 10 } ] } ], "parameters": [ { "type": "path", "name": "reqPath", "value": "reqPath" }, { "type": "method", "name": "method", "value": "method" }, { "type": "header", "name": "Host", "value": "Host" } ], "rules": [ { "match_regex": "[\"Host\",\"==\",\"www.abc.com\"]", "rule_name": "rule-jlce", "time_unit": "second", "interval": 0, "limit": 5 } ] }
Parent topic: Plug-ins