Using the Concurrency Quota Policy

Learn how to monitor web service concurrency performance by specifying a concurrency limit (quota).

About Policies Managing Policies QoS Policies

For information about using policies in the context of the developer portal, see Business Policies.

Table of Contents

  1. Introduction
  2. Creating a Concurrency Quota Policy
  3. Concurrency Quota Policy Options
  4. Configuration
  5. Concurrency Quota Policy: use cases for Policy Manager
  6. Concurrency Quota Policy: use cases for Community Manager

Introduction

A Concurrency Quota Policy is a Quality of Service (QoS) policy that allows you to monitor the web service concurrency performance by specifying a concurrency limit (quota) that represents the maximum number of connections, and configuring fault and alert notifications.

You can define a fault message by specifying the following values:

  • Name (Fault Message)
  • SOAP fault element that holds errors and status information for a SOAP message (Fault Element Name)
  • URL that points to the fault code schema (Fault Namespace URI)

You can also define Alert Codes in the Alerts > Alert Codes section and enable and select them in the policy definition.

If the specified concurrency limit is exceeded, Policy Manager returns a fault and sends an alert.

Creating a Concurrency Quota Policy

The first step in creating a policy is to define the basic policy information.

To add a QoS policy
  1. Go to Workbench > Browse > Organization, and select Policies > QoS Policies. The Policies Summary is displayed.
  2. Click Add Policy.
  3. Choose the policy type and click Next.
  4. Specify a name (required) and description (optional) and click Finish. At the Completion Summary, click Close. The Add Policy Wizard creates a draft policy instance that you can then configure on the Policy Details page.

For more information, see Add Policy.

back to top

Concurrency Quota Policy Options

The policy includes the configuration options listed below.

  • Concurrency Limit: Allows you to specify a concurrency limit (quota) that represents the maximum number of concurrency connections. If the limit is exceeded, a fault message is returned to the consumer and an alert is logged.
  • Fault Message: The name of the SOAP fault message to be returned if the quota is exceeded (<faultString>).
  • Fault Element Name: The name of the SOAP fault element that holds errors and status information for a SOAP message.
  • Fault Namespace URI: The URL that points to the fault code schema.
  • Fault Namespace Prefix: Allows you to enter the fault namespace prefix.
  • Time to Clear Alert(s): Allows you to enter the length of time for which the throughput needs to be within the limit before a second alert is sent to signify that the consumer is once again within the quota.
  • Set Reminder Alert: Enables the Reminder Alert function. This function sends the alert that is selected on the Alert Code drop-down list. The alert is sent at the Reminder Alert Interval until the consumer is within the quota.
  • Reminder Alert Interval(s): Allows you to enter an interval (in seconds) at which Reminder Alerts will be sent until the consumer is within the quota.
  • Alert Code: A drop-down menu that displays a list of custom alert codes that you have defined. If you have "Send Reminder Alert" selected, alerts will be sent based on the alert interval defined using the selected Alert Code. For more information on defining an Alert Code, see About Alert Codes in the Policy Manager Online Help.
  • Clear Alert Code: A drop-down menu that displays a list of custom alert codes that you have defined. If you have "Send Reminder Alert" selected, alerts are sent when the alert condition no longer exists.
  • Reminder Alert Code: A drop-down menu that displays a list of custom alert codes that you have defined. If you have "Send Reminder Alert" selected, alerts are sent based on the specified interval when the condition continues to be exceeded.

Back to top

Configuration

Let's take a quick walkthrough of the Concurrency Quota Policy configuration process to get you started.

Step 1: Add Policy

In Policy Manager, to create a Concurrency Quota Policy instance, go to Policies > QoS Policies and choose Add Policy.

Step 2: Modify Policy

When you click Modify to make changes to the Concurrency Quota Policy on the Policy Details page, the initial policy looks like this:

Modify Concurrency Quota page

Configure the policy options based on your requirements and click Apply.

Step 3: Attach Policy

After you've saved your policy, you can attach it to a web service, operation, or binding.

Step 4: Test Policy and View Monitoring Data

After you've attached the Concurrency Quota Policy to a web service, operation, or binding, send a request to your service and go to the Services > Monitoring section to view the results for Logs, Real Time Charts, and Historical Charts. For more information on using the monitoring functions, refer to the Policy Manager Online Help, available via the Help button.

Back to top

Concurrency Quota Policy: use cases for Policy Manager

This section provides a list of Policy Manager-specific usage scenarios for the Concurrency Quota Policy.

It includes:

  1. Scenario 1: Generate Alert When Concurrent Requests Received
  2. Scenario 2: Generate Reminder Alert When Concurrent Requests Received
  3. Scenario 3: Generate Alert When Using Contracts
  4. Scenario 4: Generate Clear Alert When Concurrency Exceeds Specified Interval

Scenario 1: Generate Alert When Concurrent Requests Received

Generate an alert and send an email to the administrators if a service receives more than 10 concurrent requests.

  1. Create a physical service in the Policy Manager Management Console using Create Physical Service.
  2. Provide service details and click Finish.
  3. Using Virtualize Service, virtualize and host the physical service on Network Director (ND1), and assign a name (for example, Vs1).
  4. Navigate to Organization > Policies > QOS Policies and use Add Policy to create a Concurrency Quota Policy.
  5. Configure the Concurrency Quota Policy with 10 Concurrency Limit and a custom Fault message.

  6. Activate the policy, and attach it to the Vs1 service in the Service Details > Policy Attachments > QoS section.
  7. Send 20 concurrent requests from the application/client to the Vs1 service.
  8. When the concurrency limit has been exceeded, the Fault Message will be returned to the service consumer and an alert will be logged at the service level.

  9. The details in the usage logs show the error being displayed as configured in the policy.

  10. In the alert code, an email must be configured that will be sent to the administrator(s) as shown below.
  11. Timeline

Scenario 2: Generate Reminder Alert When Concurrent Requests Received

Generate a remainder alert and run a Management Script if more than 10 concurrent requests per 10 seconds are received repeatedly by a service in the 100 seconds.

  1. Create a physical service in the Policy Manager Management Console using Create Physical Service.
  2. Provide service details and click Finish.
  3. Using Virtualize Service, virtualize and host the physical service on Network Director (ND1), and assign a name (for example, Vs1).
  4. Navigate to Organization > Policies > QOS Policies and use Add Policy to create a Concurrency Quota Policy.
  5. Configure the Concurrency Quota Policy with 10 Concurrency Limit and a custom Fault message. Set Remainder Alert interval to 10 seconds and Clear alert time interval to 100 seconds.

  6. Activate the policy, and attach it to the Vs1 service in the Service Details > Policy Attachments > QoS section.
  7. Send 20 concurrent requests from the application/client to the Vs1 service. Results:
    1. When the concurrency limit has been exceeded, the Fault Message will be returned to the service consumer and an alert will be logged at the service level.
    2. The details in the usage logs show the error being displayed as configured in the policy.
  8. Keep sending 20 concurrent requests from the application/client to the Vs1 service. Results:
    1. During the first 10 seconds no alert is shown.
    2. If the concurrency hits are seen after 10 seconds, a remainder alert is thrown which is valid for the next 10 seconds.
    3. After the first interval of 10 seconds, if the concurrency hits are still observed, there is another remainder alert.

    4. Within the clear interval, for every 10 seconds, this alert is thrown if validation crosses
    5. In the Alert code, a script can be configured to run (for example, to store any sort of information related to the alert).

Scenario 3: Generate Alert When Using Contracts

Generate an alert if an application hits a contract when sending more than 15 concurrent requests to various services using the contract

  1. Create a physical service in the Policy Manager Management Console using Create Physical Service.
  2. Provide service details and click Finish.
  3. Using Virtualize Service, virtualize and host the physical service on Network Director (ND1), and assign a name (for example, Vs1).
  4. Navigate to Organization > Policies > QOS Policies and use Add Policy to create a Concurrency Quota Policy.
  5. Configure the Concurrency Quota Policy with 15 Concurrency Limit and a custom Fault message.
  6. Activate the policy, and attach the Concurrency Quota Policy to a contract which serves Vs1 and Vs2 services.

  7. Send 25 concurrent requests from the application/client to Vs1 and Vs2 services all together
    1. When the concurrency limit has been exceeded, the Fault Message will be returned to the service consumer and an alert will be logged at contract level.
    2. The details in the usage logs show the error being displayed as configured in the policy.

Scenario 4: Generate Clear Alert When Concurrency Exceeds Specified Interval

Generate a clear alert and send an email to the administrator when concurrency is no more exceeded in the 100 seconds interval

  1. Create a physical service in the Policy Manager Management Console using Create Physical Service.
  2. Provide service details and click Finish.
  3. Using Virtualize Service, virtualize and host the physical service on Network Director (ND1), and assign a name (for example, Vs1).
  4. Navigate to Organization > Policies > QOS Policies and use Add Policy to create a Concurrency Quota Policy.
  5. Configure the Concurrency Quota Policy with 10 Concurrency Limit and a custom Fault message.
  6. Activate the policy, and attach it to the Vs1 service in the Service Details > Policy Attachments > QoS section.
  7. Send 20 concurrent requests from the application/client to the Vs1 service.
    1. When the concurrency limit has been exceeded, the Fault Message will be returned to the service consumer and an alert will be logged at the service level.
    2. The details in the usage logs show the error being displayed as configured in the policy.
    3. In the next 100 seconds, if the policy is not violated, a clear alert is sent.

    4. In the clear alert code, an email must be configured that will be sent to the administrator(s) as shown below:

Timeline (Scenarios 2 and 4)

Back to top

Concurrency Quota Policy: use cases for Community Manager

This section provides a list of Community Manager-specific usage scenarios for the Concurrency Quota Policy.

It includes:

  1. Add / Configure Concurrency Quota Policy
  2. Scenario 1: How Do I Verify Concurrency Quota Policy at the Service Level?
  3. Scenario 2: How Do I Verify Concurrency Quota Policy at the Contract Level?
  4. Scenario 3: How Do I Verify Concurrency Quota Policy at License > Term Level?

Add / Configure Concurrency Quota Policy

If you are using a Concurrency Quota Policy with Community Manager, you must first add the policy to the Community Manager Tenant Organization in Policy Manager. Once that's done, it will be available for selection in the developer portal.

  1. Go to the Policy Manager Management Console > Tenant Organization > Policies > QoS Policies and click Add Policy.

  2. Specify Policy Name, Policy Type (Concurrency Quota Policy), click Finish, and then click Close.

  3. On the Concurrency Quota Policy Details screen, click Modify.

  4. Provide the policy details and click Finish.

  5. Activate the policy.

Scenario 1: How Do I Verify Concurrency Quota Policy at the Service Level?

  1. Launch Community Manager.
  2. Attach the Concurrency Quota Policy to the API implementation.

  3. Request API access. Verify that the contract is activated.

  4. Go to Test Client and send continuous requests. This policy condition will be met only when hitting concurrent requests (i.e., sending multiple requests in 1 second). This behavior is shown below using SoapUI and Test Client.
  5. Start one load test to send continuous requests from SoapUI. Also send requests from Test Client one by one. When multiple requests are received, the policy condition is met and you'll see a fault message in the response window.

  6. Alerts will be displayed in the Community Manager API> BOARD (as shown below).

Scenario 2: How Do I Verify Concurrency Quota Policy at the Contract Level?

  1. Attach the Concurrency Quota Policy at the Contract Level and activate the contract.

  2. Now Go to Test Client and send continuous requests. This policy condition will meet only when hitting concurrent requests (i.e., sending multiple requests in 1 second).
  3. This behavior is shown below using SoapUI and Test Client.
  4. Start one load test to send continuous requests from SoapUI. Also send requests from Test Client one by one. When multiple requests are received, the policy condition is met and you'll see a fault message in the response window.

  5. Alerts will be displayed in the Board for the API.

  6. Alerts will also be displayed in the Policy Manager Registry.

Scenario 3: How Do I Verify Concurrency Quota Policy at License > Term Level?

  1. Edit License and attach Concurrency Quota Policy.

  2. Next, test the Concurrency Quota Policy at the License term level. This assumes that the same scope (as above) is used for Scope mapping, and the same license is selected while requesting API access.
  3. Go to Test Client and send continuous requests. This policy condition will be met only when hitting concurrent requests (i.e., sending multiple requests in 1 second).
  4. This behavior is shown below using SoapUI and Test Client.
  5. Start one load test to send continuous requests from SoapUI. Also send requests from Test Client one by one. When multiple requests are received, the policy condition is met and you'll see a fault message in the response window.

  6. Alerts will be displayed in Community Manager, in the Board for the API.

    In the API Monitoring Logs, the following logs will display for concurrency faults.

Back to top