Skip to end of banner
Go to start of banner

Client Throttling

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Limits Task invocations for a given client over a window of time by throttling or rejecting requests from that client. Installing this API policy can help protect a Snaplex from being overloaded by too many requests.

Parameter NameDescriptionDefault ValueExample
LabelRequired. The name for the API policy.

When this policy should be applied

An expression enabled field that determines the condition to be fulfilled for the API policy to execute.


N/Arequest.method == “POST”
Service TiersChoose the levels of service to apply to clients. Enter each Condition as an expression that is evaluated against a request and used with the specified limits to restrict the request rate. If no matches are found, the limits defined in Default Tier are used.

Condition

The expression that defines this service tier. The expression has access to the request object, so the condition can match on the method, request headers, URI, and the user name or roles.


False
  1. To match POST requests:
    request.method == 'POST'

  2. To match POST requests from users with the “admin” role:
    request.method == ‘POST’ && request.isUserInRole('admin')

Limit

The number of requests to allow for the defined period. 

This field determines the client’s quota over the long-term with a separate short-term quota used to prevent bursts of requests from overloading a Snaplex. For example, if a service tier is set to allow 5,000 requests per hour, it would be undesirable for all of those requests to be allowed through in a single minute.

1000
Per

The unit of time for the period.

HOURS
ThrottlingThese settings control how requests that are over the limit will be handled. A request can be queued and retried if the limit will be refreshed within a certain time. Otherwise, it will be rejected with a 429 Too Many Requests error.

Attempts

The number of attempts to try before rejecting a request.

3
Delay in ms

The number of milliseconds to delay before retrying a request.

This field determines the timeframe before the token refill in which requests can be queued. If the request arrives well before the refill time, it is rejected.

The client connection to the server is kept open during this delay and continues to consume resources. Setting this value too high can result in clients consuming too many resources.

500
Default TierThe limit to apply when none of the given service tier conditions is matched. See Service Tiers for settings descriptions.

Peek Calculation Chart

With the Client Throttling policy enabled, the maximum number of calls that the the system limits within a minute is 1000.

The following expression gives you the smallest number between a 1000 and the ceiling of your limit divided by 10, where the function returns the smallest integer value equal or greater than value:

Math.min(1000, Math.ceil(limit / 10)) = Smaller of one of the two numbers: 1,000 or the ceiling of your Tier's Limit / 10

Use the following matrix to determine the peak limit based on the policy Tier Limit:


API Calls
Per (Unit of Time)Less than or equal to 60Greater than 60
Minutes 5 per secondMath.min(1000, Math.ceil(Limit / 10)) per second
Hour5 per minuteMath.min(1000, Math.ceil(Limit / 10)) per minute
Day5 per minuteMath.min(1000, Math.ceil(Limit / 10)) per minute
  • No labels