Traffic Optimization
This policy limits the number of API invocations during a specified time interval, and sends alerts to a specified destination when the performance conditions are violated. You can use this policy to avoid overloading the back-end services and their infrastructure, to limit specific clients in terms of resource usage, and so on.
- Policy violation event. Indicates the violations that occur for an API. If there are 100 violations, then 100 policy violation events are generated.
- Monitor event. Controlled by the alert frequency configuration specified in the policy.
Property | Description |
---|---|
Limit Configuration | |
Rule name | Specifies the name of throttling rule to be applied. By default, the Total Request Count appears as the rule name and you cannot modify this. |
Operator | Specifies the operator that connects the rule to the value specified. By default, the Greater Than operator is selected. It indicates that the throttling rule is applied when the Total Request Count for an API is greater than (exceeds the limit specified for) the value specified in the Value field. |
Value | Specifies the value of the request count beyond which the
policy is violated. When multiple requests are made at the same time, it might be possible that this limit applied to trigger an alert is not strictly adhered to. There is no loss observed in the invocation counts data, but there might be a minor delay in aggregating the count. The invocation count gets incremented, only when webMethods API Gateway receives the response from the native API. For example, if you have set the limit at 5 with an interval alert of 1 minute and if you invoke 5 requests in parallel, out of which for 1 of the request the native API delays sending the response to webMethods API Gateway. In such cases, the invocation count would still be 4 as the native API is yet to send the response to webMethods API Gateway. There is a minor delay in aggregating the count due to native API response delay. Hence, webMethods API Gateway allows additional invocation. However, when the invocation count exceeds 5 an alert is triggered. |
Destination | Specifies the destination to log the
alerts.
Select the required options:
|
Alert Interval | Specifies the interval of time for the
limit to be reached.
The timer starts once the first API is activated and resets after the configured time interval. If an API is deactivated the interval gets reset, and on API activation the time interval starts afresh. |
Unit | Specifies the unit of measurement of the
Alert Interval configured, to monitor
performance, before sending an alert. For example:
|
Alert Frequency | Specifies the frequency at which the
alerts are issued and the monitor events are logged.
Specify one of the options:
|
Alert Message | Specifies the text message to be included in the alert. |
Consumer-specific throttling | Specifies whether the configured
invocation limit has to apply to all consumer applications together or to each
application individually.
Note: This field is applicable only when you select the
required applications from the
Consumer Applications field.
Possible values:
|
Consumer Applications | Specifies the consumer applications for
which the policy is applied. Do one of the following:
Note: If you select
All consumers or
Each consumer from this field and
specify
Registered applications from the
Application Lookup Control field of
the corresponding
Identify & Authorize policy,
then only the registered applications are allowed to invoke the API. In such
scenarios, only the registered consumer applications can utilize the specified
invocation limit.
You can invoke APIs using non-registered consumer applications only if the Global applications or Global applications and DefaultApplication option is selected from the Application Lookup Control field of the corresponding Identify & Authorize policy. |
Traffic Optimization Policy Enforcement Scenarios
You can enforce more than one Traffic Optimization policy for an API based on your requirement. This section lists a sample requirement scenario and the possible solution:
How do I?
- Allow 1000 invocation per minute for each registered consumer application.
- Allow 500 invocation for 15 minutes for all non-registered consumer applications.
Possible solution
Create two Traffic Optimization policies with the following specifications
- Policy 1
- Value. 1000.
- Alert Interval. 1.
- Alert Frequency. minute.
- Consumer Applications. Each registered consumer.
- Policy 2
- Value. 500.
- Alert Interval. 15.
- Alert Frequency. minute.
- Consumer Applications. All non-registered consumers.