WSO2 Business Process Server v3.1.0 Documentation

##### Overview

- Home
- Release Note
- WS-BPEL Compliance
- License

##### Downloads

- Releases

##### Installation Guide

- Installing WSO2 BPS

##### Quick Start Guide

- Modeling the process
- Deploying the process
- Testing the process

##### User Guide

- Deploying BPEL Processes
- Deploying Human Tasks
- Managing BPEL processes
- Managing BPEL process instances
- QoS for BPEL processes
- Securing BPEL processes
- Invoking secured partner services
- Versioning
- Management API

##### Human Task Guide

- Human Tasks Quick Start Guide
- Deploying HumanTasks
- Managing Tasks
- Developing a Human Task Artifact
- Human Task Management and Configuration
- Human Task Concepts

##### Administrator Guide

- External data sources Configuration
- Registry Configuration
- Events
- Unified Endpoints
- BPEL Extensions
- Transaction Factory Configuration
- Message Exchange Interceptors
- OpenJPA specific properties
- JMS Transport Configuration
- Process Instance Cleanup Tasks
- Process Hydration and Dehydration
- Enabling Peer-to-Peer(P2P) Communication
- Setting up a BPS Cluster

##### Best Practices

- Process Deployment Best Practices

##### Concepts

- Process Versioning
- Process instance events
- Partner links

##### WS-BPEL Extensions

- Activity Failure and Recovery
- Extension Activities and Extensible Assign Operations
- XPath Extensions
- Iterable ForEach
- Flexible Assigns
- BPEL4People Extension

##### Samples

- HelloWorld
- If-Else
- ForEach
- While
- Repeat Until
- Flow and Links
- Pick
- Synchronous and Asynchronous Service Invocations
- Fault Handling
- Split
- XslTransform
- Compensation Handler
- Event Handler

##### Resources

- FAQ
- External Articles
- Library
- Source Code

##### Community

- Forum
- Mailing Lists

##### Project Information

- Issue Tracking

# Access Throttling

In Web service interactions, we usually have to restrict the number of requests that the web service serves for a particular client. The throttle mechanism is used to control access to our services at different levels.

The WSO2 Web service Application Server (WSAS) provides an effective and efficient way to apply the throttle mechanism to your Web services.

## Levels of Throttling

Throttling can be enabled at global level, service level or operation level.

- If it 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.
- If it is enabled only for an operation in a given service, restrictions are applied only for the messages accessing that particular operation.

The WSO2 WSAS provides the throttling mechanism at global level or service level.

## Adding Throttling to a Service

Use this function to add a throttle parameter that specifies a variable millisecond wait between calls or a variable maximum number of calls per unit of time. This would facilitate the smooth operation of Web services and REST using the Web service and HTTP client steps.

The throttling option is disabled by default. If you want to add the throttling mechanism, you should enable it.

1. In the navigator, under Manage/Service, click List. The Deployed Services page appears.
2. Select the service for which you want to enable throttling. The Service Dashboard page (for that service) appears.
3. In the Quality of Service Configuration panel, click Access Throttling. The Throttling Configuration page appears.
4. In the Enable Throttling list, click Yes.The existing throttle configuration appears in the wizard

Figure 1: Throttling Configuration

5. Click Add New Entry. To enter new parameters or modify existing parameters click Allow in the Access list.

If you set the parameters for a particular service, your configuration will be applied only to that particular service. On the other hand, if you reached this page from global configurations, these configurations will be applied globally.

6. Click Finish. Throttling will be engaged for that particular service or it will be engaged globally.

Field Descriptions

## Functions of Buttons

- Finish : Click Finish to submit the current data. When finished, your throttle configuration will be applied and the page will be redirected to the previous page.
- Reset : Click Reset to load the last submitted configuration.
- Default : Click Default to load the default throttle configuration. If you want to submit those data, you have to click Finish.
- Clear : Click Clear to clear all the text boxes in the UI.
- Back : Click Back to go to the previous page.

## Parameters for Throttling Configuration

#### Fields

Field Name | Description
Maximum Concurrent Accesses | It can be used to control the number of requests that are served at any given moment. If throttling is enabled globally, this value will be the maximum number of requests that are served by all the services deployed in the server at a given moment. If throttling is enabled at service level, it is the maximum requests for that particular service. In the case of operation level, it is the maximum requests for that particular operation.
Range | The IP address range or the domain is restricted from accessing the service. Requests from such clients will be restricted based on 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 (e.g., 10.100.1.30-10.100.1.60). It should be DOMAIN if the range is given as as a domain (e.g., *.wso2.com). If you specify configurations types of both 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 t he said fields are de-activated. If it is Control, then the specified constraints are applied for that particular range.

Access constraints are divided into the following three parameters.

- Maximum Request Count (MRC)
    If Allow Access is set to Control, it will be the maximum number of requests that are served within the time interval specified by the Unit Time parameter.
- Unit Time (UT) -
    The time period in milliseconds during which the maximum requests served. This is the number specified by the Maximum Request Count.The throttle starts counting the number of units from the moment it is enabled and the number of requests served within that period.
- Prohibit Time Period (PTP)
    If the maximum request count is achieved before the unit time, this is the period during which no more requests are allowed to go in. By setting this value, the 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)