Throttle Component User Guide

 

Introduction

Throttle mechanism is used to control access to services in different levels. It can be enabled at global level, service level or in operation level. If throttling is enabled globally, restrictions are applied globally (for every message coming into the server). If it is enabled for a particular service, restrictions are applied to all the messages coming into that service. And if it is enabled only for an operation in a given service, restrictions are applied only for the messages accessing that particular operation.

This Throttle component UI can be used to enable throttling at global level or service level. If you have entered this UI through a particular service, your configuration will be applied to that particular service. On the other hand, if you came through global configurations, this will be applied globally.

 

User interface to enable throttling

Following diagram shows the user interface of the throttle component.

Throttle UI

The "Enable Throttling?" option can be used to enable or disable throttling. If you select "Yes", it will show the currently existing throttle configuration on the UI. After doing whatever changes in the configuration, "Finish" button can be used to engage throttling for the particular service.

Maximum Concurrent Accesses parameter can be used to control the number of requests that are served at any given moment. If throttling is enabled globally, this value is the maximum number of requests that are served by all the services deployed in the server at the given moment. If throttling is enabled in service level, it is the maximum for that particular service. And in the case of operation level, it is the maximum for that particular operation.

The table shown in the UI can be used to apply restrictions for specific users.

 

Fields in the configuration table

Range : The IP address range or the domain to restrict. Requests from those clients will be restricted using the specified values

Type : This indicates the type of Range. It can be "IP" or "DOMAIN". It should be "IP" if the Range is given as a single IP address or a range of IP addresses (Eg: 10.100.1.30-10.100.1.60). It should be "DOMAIN" if the range is given as as a domain (Eg: *.wso2.com). If you specify configurations of both types "IP" and "DOMAIN", first priority will be given to "DOMAIN" level configurations.

Access : If this is set to "Allow", no restriction is applied for that range and all requests are allowed to go in as they come in. If it is "Deny", access is completely denied for that range. When the Access is set to "Allow" or "Deny", MRC, UT and PTP parameters are not necessary and those fields are deactivated. If it is "Control", then the specified constraints are applied for that particular range. These constraints are given through following three parameters.

Maximum Request Count (MRC) : If Allow Access is set to "Control" this is the maximum number of requests that are served within the time interval specified by Unit Time parameter.

Unit Time (UT) : Time period in milliseconds in which the maximum requests served is the number specified by Maximum Request Count. Throttle starts counting periods of this amount of milliseconds from the moment it is enabled and number of requests are measured within that period.

Prohibit Time Period (PTP) : If the Maximum Request Count is achieved before Unit Time, this is the period for which no more requests are allowed to go in. By setting this value, Unit Time slot is altered.

 

Example : MRC = 50, UT = 50000, PTP = 5000 If 50 requests are arrived within 35000ms (35s) in a particular time period, no more requests are taken in for another 5000ms (5s = PTP). This time the UT is altered to 35000ms + 5000ms = 40000ms (40s)

 

Buttons and links to control

     : To delete the particular row in the table in front of which the button exists

Add New Entry : To add a new row into the table

Finish : To submit the currently shown configuration

Reset : To load the last saved configuration

Default : To load the default configuration

Clear : To clear all text areas in the UI

Cancel : To cancel the configurations which are not submitted and go back to the previous page