You are on page 1of 5

8/22/2014

Throttling in OSB (Knut Vatsendvik's Blog)

Throttling in OSB
By Knut Vatsendvik on Apr 28, 2010

Technorati Tags: soa,integration,osb,throttling,overload protection


A common problem with integration is the risk of overloading a particular web service. When the capacity of a web service is
reached and it continues to accept connections, it will most likely start to deteriorate.

Fortunately there are 2 techniques, with Oracle Service Bus, that you can apply for protecting this from happening. You can
either limit the concurrent number of requests for a Business Service (outbound requests) or you can limit the number of
threads processing the requests for a Proxy Service (inbound requests).

Limiting the Concurrent Number of Requests


Limiting the concurrent requests for a Business Service cannot be set at design time so you have to use the built-in Oracle
Service Bus Administration Console to do it (/sbconsole). Follow these steps to enable it:
1.
2.
3.
4.

In Change Center, click Create to start a new Session


Select Project Explorer, and navigate to the Business Service you want to limit
Select the Operational Settings tab of the View a Business Service page
In this tab, under Throttling, select the Enable check box. By enabling throttling you
a. Specify a value for Maximum Concurrency
b. Specify a positive integer value for Throttling Queue to backlog messages that has exceeded the
message concurrency limit
c. Specify the maximum time in milliseconds for Message Expiration a message can spend in
Throttling Queue

5. Click Update
6. Click Active in Change Center to active the new settings

https://blogs.oracle.com/knutvatsendvik/entry/throttling_in_osb

1/5

8/22/2014

Throttling in OSB (Knut Vatsendvik's Blog)

If you re-publish the service, it will not overwrite the settings. Only if the resource is renamed or moved, it will.
Please note that 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.

Limiting the Number of Threads


A better approach, in my opinion, is to limit the number of threads that can work with request. Follow these steps to do it:
1. Open the WebLogic Server Console (/console)
2. In Change Center, click Create to start a new Session
3. In the left pane expand Environment and select Work Managers

4. In the Global Work Managers page, click New

5. Click the Work Manager radio button, then click Next

https://blogs.oracle.com/knutvatsendvik/entry/throttling_in_osb

2/5

8/22/2014

Throttling in OSB (Knut Vatsendvik's Blog)

6. Enter a Name for the new Work Manager, and click Next
7. In the Available Targets list, select server instances or clusters on which you will deploy applications that
reference the Work Manager
8. Click Finish.
The new Work Manager now appears in the Global Work Managers page.
9. Select the new Work Manager
10. Right next to the Maximum Threads Constraint drop-down box, click New

11. Click the Maximum Threads Constraint radio button, then click Next

https://blogs.oracle.com/knutvatsendvik/entry/throttling_in_osb

3/5

8/22/2014

Throttling in OSB (Knut Vatsendvik's Blog)

12. Enter a Name and a thread Count to be the maximum size to allocate for requests. Click Next

13. In the Available Targets list, select server instances or clusters on which you will deploy applications that
reference the Work Manager
14. Click Finish
15. Click Save
16. Click Active in Change Center to active your changes. A restart may be necessary.
Puh! Almost there.
17. Start a new session. Go to the Service Bus Console (/sbconsole) and find your consuming Proxy Service.
18. Click the Edit button of the Transport Configuration tab.
19. Click Next

https://blogs.oracle.com/knutvatsendvik/entry/throttling_in_osb

4/5

8/22/2014

Throttling in OSB (Knut Vatsendvik's Blog)

20. Set the Dispatch Policy to the new Work Manager

21. Click Last


22. Click Save
23. Click Active in Change Center to active your changes.

https://blogs.oracle.com/knutvatsendvik/entry/throttling_in_osb

5/5

You might also like