Rate Limit is applied using DataScript. Arbitrary characteristics are defined and evaluated to decide which requests are to count against the rate limit. This gives us maximum flexibility. All the actions which are supported through DataScript, can be applied when the limit is reached.
The new DataScript API for the rate limit is avi.vs.ratelimit.exceed
.
New DataScript API – avi.vs.ratelimit.exceed(rl_name, request_key, [consume])
The following are the parameters used in DataScript rate limiter:
rl_name
: This refers to the rate limit object name.request_key
: This is an arbitrary string used to allow any property or combination of properties to be used to identify requests.consume
: This is the number that this API consumes in the rate limiter bucket, The default value is one. This function indicates whether the request is above the threshold or not.rl_action_close_conn
: This will send a TCP FIN and only be relevant for TCP.rl_action_local_rsp
: This will send an HTTP local response and only be relevant for HTTP.rl_action_redirect
: This will send an HTTP redirect and again only be relevant for HTTP.