Rate Limit
This tab-based feature in the vConnect module allows the API gateway to control and manage the number of the requests based on several factors. You can apply the “Rate Limit” feature in the following scenarios:
- To protect APIs from common types of security attacks, such as certain types of denial of service (DoS) attacks
- To regulate data traffic for the available infrastructure
- To make an API, application, or resource available to the customer at different levels of service, specifically for monetization purposes
You can configure the rate limit at the app level or service level as follows:
Configuring Rate Limit
To configure the rate limit at the app level, you add a rule to the application. When you add a rule, you define a maximum number of requests that the API gateway can process during a specific timeframe. You also define the timeframe that the API gateway will take to store requests before processing them.
Note:- You can add a single rule at the app level. You cannot add multiple rules at the app level.
When you plan to configure the rate limit at the service level, you can define a dedicated rule for each service. It means that you can define multiple rules under the Service tab.
To configure the rate limit:
- On the vConnect module’s dashboard, see the left navigation panel.
- In the left panel, click Rate Limit to display the Rate Limit area in the right panel.
- In the Rate Limit area, click one of the following tabs:
- App:- Click this tab to configure the rate limit at middleware level.
- Service:- Click this tab to configure the rate limit for one or more services.
- After you click the App tab or Service tab, you do the following:
Case1:- (Assume you click the App tab)
- In the App tab, click Add Rule to display the App: Add Rule dialog box.
- In the App: Add Rule dialog box, add a rule to configure the rate limit as follows: :
Field | Description |
App Name | Click this list, and then select the app to which you want to apply the rule. |
Request Allowed | In this field, enter a numeric value (for example, 40). This value specifies the number of maximum requests that the API gateway will process. |
Duration of the request accumulated | In this field, enter a numeric value (for example, 18). This value specifies the total time that the API gateway will take to accumulate a specific number of requests before processing them. |
Unit | This field by default displays the unit of time in seconds. |
- After you enter a value in the related field, click Save to add the rule.
Case2:- (Assume you click the Service tab)
- In the Service tab, click Add Rule to display the Service: Add Rule dialog box.
- In the Service: Add Rule dialog box, add a rule to configure the rate limit as follows:
Field | Description |
Service Name | Click this list, and then select the service to which you want to apply the rule. |
Request Allowed | In this field, enter a numeric value (for example, 40). This value specifies the number of maximum requests that the API gateway will process. |
Duration of the request accumulated | In this field, enter a numeric value (for example, 18). This value specifies the total time that the API gateway will take to accumulate a specific number of requests before processing them. |
Unit | This field by default displays the unit of time in seconds. |
- After you enter or select the value in the related field, click Save to add the rule.