50 Throttling

This chapter describes how to enable and use throttling in Oracle Service Bus.

Throttling, which lets you control the amount of message traffic to a business service, helps improve performance and stability by preventing message overload on high-traffic business services.

This chapter contains the following sections:

50.1 How to Enable Throttling

You must enable throttling for a business service from the Operational Settings tab of the View a Business Service page. In this tab, under Throttling select the Enable check box for the Throttling State. When you enable throttling for a business service you must specify values for Maximum Concurrency. You can also specify the Throttling Queue and Message Expiration for the business service. For more information, see Section 50.2, "What are the Operational Settings for Throttling?" and Section 26.9, "Configuring Operational Settings for Business Services."

Table 50-1 provides some important definitions in throttling.

Table 50-1 Important Definitions

What is … Definition

Throttling queue

The priority queue in which the messages are enqueued when business services reach their maximum concurrency. Messages with higher priority are processed first. Messages are processed on a first-in first-out basis, if they have the same priority. You can assign priority to messages using the routing options.

Notes:

  • The greater the integer for priority, the higher is the priority of the message.

  • You can configure only one queue for a business service

A throttling queue is an in-memory queue. Messages that are placed in this queue are not recoverable when a server fails or when you restart a server.

When you delete or rename a business service, all the messages in the throttling queue are discarded.

Message priority

The priority of a message in the throttling queue.

Expired message

A message that has been in the throttling queue for an interval greater than the value of message expiration. For more information on message expiration, see Table 50-2.


50.2 What are the Operational Settings for Throttling?

Table 50-2 describes the operational settings for throttling.

Table 50-2 Operational Settings for Throttling

Operation Setting Use this to …

Throttling State

Enable or disable throttling for a business service.

Note: When you disable throttling for a business service at runtime, all messages in the throttling queue are processed without throttling.

Maximum Concurrency

Restrict the number of messages that can be concurrently processed by a business service. This must be a positive integer. When this threshold is reached for a business service, all the incoming messages for the business service are placed in a throttling queue until the business service can accept more messages.

Any change to this setting affects both new messages and those already in the queue. When you increase the value, the Oracle Service Bus runtime allows more messages to be sent to the business service after processing those in the queue first. When you decrease the value, the Oracle Service Bus runtime places any new messages in a throttling queue until the concurrency setting goes below the new threshold, if you have defined a throttling queue. If you have not defined a throttling queue, the messages are discarded.

In a cluster environment, the number of messages that can be concurrently processed by a business service is equally divided among the Managed Servers.

Note: You can set this operational setting only if you enable throttling for the business service.

Throttling Queue (operational setting)

Restrict the number of messages in the throttling queue. The length of the throttling queue must be positive integer. All the incoming messages beyond the maximum concurrency limit for the business service are placed in the throttling queue. When the queue is full, the message in the queue with the lowest priority will be removed from the queue if a new incoming message has a higher priority.

If you set this length to be equal to zero, it implies that a throttling queue does not exist for the business service.

Any change to this setting is dynamically implemented. When you decrease the value for this setting, all the messages beyond the new length are discarded.

Note: You can set this operational setting only if you enable throttling for the business service.

In a cluster environment, this is equally divided among the Managed Servers.

Message Expiration

Restrict the maximum time (in milliseconds) spent by a message in the throttling queue of a business service. This must be a positive integer. When this time has elapsed, the message is removed from the queue. These messages are referred to as expired messages.

If the message expiration is set to zero for a service, the messages in throttling queue for this service will never expire.

When you increase the value for this setting, the expiration time for the new messages and the messages that are already present in the queue is increased. When you decrease the value, all the messages that have exceeded the new value are immediately discarded.

Note: You can set this operational setting only if you enable throttling for the business service.


50.3 What Metrics are Available for Throttling?

Table 50-3 describes the metrics that are available for throttling.

Table 50-3 Throttling Metrics

Metrics Description

Max Throttling time

The maximum time spent by all messages in the throttling queue in milliseconds. If this value is greater than zero for a business service, it indicates that messages are placed in the queue for the business service.

Min Throttling time

The minimum time spent by all messages in the throttling queue in milliseconds. If this value is equal to zero some messages are not placed in the throttling queue.

Average Throttling time

The average the time spent by all messages in the throttling queue in milli seconds.


For more information about throttling metrics, see Section 50.4, "How to Access Throttling Metrics."

50.4 How to Access Throttling Metrics

You can access the throttling metrics from the Service tab of the Service Monitoring Details page in the Oracle Service Bus Administration Console. You can obtain the metrics for the current aggregation interval and for the interval since the last reset. For more information, see Section 46.5.1, "How to Access Service Statistics from the Oracle Service Bus Administration Console."

You can also access the metrics using JMX Monitoring APIs. For more information, see Section 46.9.3, "Viewing SLA Alerts in the Dashboard."

50.5 How to use Throttling Metrics for Alerting

You can define an SLA alert rule based on throttling metrics. You can define the alert rule based on Average Throttling Time. For more information, see Section 26.23, "Creating and Editing Alert Rules."

50.6 How to use Throttling for Business Services with Multiple Endpoint URIs

This topic provides information on using throttling for business services with multiple endpoint URIs.

In Oracle Service Bus, a business service can be associated with multiple endpoint URIs. For more information on endpoint URIs, see Chapter 48, "Managing Endpoint URIs for Business Services." When you associate a business service with multiple URIs, you must configure the maximum concurrency for the business service and not the individual URI. The maximum concurrency for each URI is set internally depending on the overall maximum concurrency and the load balancing weight, based on the following equation:

URI-specific max_concurrency = [User configured max_concurrency] X [weight]

For example, consider a business service B with three endpoint URIs eu1, eu2, and eu3. The load balancing algorithm is defined as random-weighted. The weights of the URIs are 1, 2, and 3 respectively. Assuming that you have defined a maximum concurrency of 10 for the business service, the URI specific maximum concurrency is 10, 20, and 30. The effective maximum concurrency of the business service B is 60. If the last endpoint URI that has a weight of 3 is offline, the effective maximum concurrency of the business service is 30.

Notes:

The weights for the URI when the load balancing is round robin or random is 1. When the load balancing is None the weight of the primary URI is 1 and the weight of the backup URI is 0. The weight of the backup URI becomes 1 when the primary URI goes offline.

Messages for which the endpoint URI is overridden in routing options are not throttled. Messages are also not throttled with session stickiness enabled.

50.6.1 What Happens to Retried Messages During Throttling?

When failover is enabled on a service, retried messages are not throttled. The message is sent to the next URI regardless of the operational settings for throttling.

Messages that are expired or that are discarded, because the throttling queue is full or because the service reached its maximum concurrency, are not retried.