Oracle SOA Suite 12c: throttling control in BPEL to avoid contentionGepubliceerd: Auteur: Eduardo Barra Cordeiro Categorie: Oracle
When you work with inbound JCA adapters (for instance JMS, AQ, MQ) in SOA Suite it is necessary to be able to control the TPS (transactions per second). It will allow you to avoid stuck threads in case you receive batch messages that usually are not expected in the domain load tuning. In this short post I will show how to setup the parameters and calculate your TPS.
- Add the minimumDelayBetweenMessages in the code
This is the parameter that will do the magic. It adds a thread sleep as part of the instance execution, that is, on a per polling thread basis. The setting is measured in milliseconds.
- How to do that?
The property will be add in the SCA file (composite.xml) in your project. It is a <Service> properties related with the partner link adapter that connect in your JCA resource.
Note: it is not a binding property.
When you deploy your code in the SOA server you will be able to check the value in the JCA adapter using EM console. You can also change it on the flight in case you need to tune the value and test it.
3. How to calculate the TPS?
Consider the scenario where you need to control throttling in a domain where you have:
- 4 managed servers nodes
- 2 threads per adapter (set in InboundThreadCount parameter)
- 500 milliseconds (0.5 second) set in minimumDelayBetweenMessages
To calculate the TPS use this formula:
(MS nodes * thread count) / (minimumDelay/1000)
In this example you will have (4 * 2) = 8 threads connected in the queue. Each thread will delay 500/1000 = 0.5 second before push a new message. You will have max 16 TPS.
According Oracle documentation
Accordingly with Oracle documentation, if the instance execution itself (the time between the two most recent message publications) exceeds the value of minimumDelayBetweenMessages, no delay will be added (hence the name "minimumDelay...").
It means that setting the minimumDelay you will set the maximum TPS, that can be lower in case your thread transaction execution time is higher than the minimumDelay parameter.