Friday, January 05, 2007

Tuning BPEL in a nutshell

Ok, after doing some projects, I run into issues regarding performance and stability. The to tune the BPEL process manager take this into account:

Make sure you have to latest patches applied of BPEL. The latest patches can be found a metalink.

If you are using BPEL processes that are intensively using the DB-Adapter or AQ-Adapter. Verify that the max number of connections is high. Change the connection pooling in the data-source.xml file. For 10.1.3 this file can be found in $ORACLE_HOME/j2ee/oc4j_soa/config/data-sources.xml. Make sure your oc4j-ra.xml file (DbAdapter/AqAdapter) is using data sources in the JNDI lookup. In 10.1.0.2 verify that the max-read max-write connections are high.

If you are using many async processes that are using the hydration store for persistence, verify that the max number of connections is high. Change the connection pooling in the data-source.xml file. This file for 10.1.0.2 and 10.1.3 can be found in $ORACLE_HOME/j2ee/oc4j_soa/config/data-sources.xml.

While we see locks on the ydration store when we run a high load of process, increase the initrans of the tables "CUBE_INSTANCE" "CUBE_SCOPE".
  • alter table CUBE_INSTANCE initrans 16;
  • alter table CUBE_SCOPE initrans 16;
You can also apply this for the indexes; alter index initrans

Make sure that the following formula applies:
  • SUM(WorkBean + InvokerBean) >= SUM(dspMaxThread for each domain)
  • SUM(dspMaxThreads for each domain) <= BPEL Datasource
Do not increase the Java Heapsize to large. This could lead into swapping or too much overhead in JVM. In general I suggest to set the -Xms and -Xmx equal and make these 1 GB or 2GB (the half of psychical memory). Leave at least 30% memory for de rest; O/S, Apache...

Garbage collection is happening when the BPEL PM is overloaded with tasks. Full garbage collection will take place. A parameter that influence this behavior,a bit, is to reduce the Java stack size. By default the stacksize is 512KB. This is for each thread. If you have short running processes, they do not occupy a large stack. You can reduce the stack size. Use the value -Xss128k or even -Xss96k.

The determine the correct setting for WorkerBean and the InvokerBean is hard to tell. My experience is to set the WorkBean to a value around 100 and the InvokerBean 50. Run some performance test to determine your ideal values on which the system is performing well. If you have CPU left, increase these values and also the dspMaxThreads for the particular domain.

Another nice performance advantage is to increase the value of the "com.oracle.bpel.expirationAgent.threadCount". By default this value is 10. Run tests to determine your value. I experienced good results with 30 and 50. The value van be set in the file:

  • 10.1.0.2: "$ORACLE_HOME/integration/orabpel/domains/default/config/quartz-config.properties"
  • 10.1.3: "$ORACLE_HOME/bpel/domains/default/config/resources-quartz.properties"
When you have a lot of BPEL processes instances running, the BPEL PM must get the unique instance number to create this instance, and even to store it in the dehydration store, the key is retrieved from a internal hash table. If it runs out of this table, it will be refilled. The initial size of this table is 100. Increasing this value to large number reduces contention. The property can be found in the domain.xml file for the particular BPEL domain. The name of the property is "instanceKeyBlockSize". Set this value high, for example 100000.

Another bottleneck I saw, was in the Apache threads, the Apache client process. Tune the number of spare servers well. Set the value MaxRequestsPerChild to a non zero value. Otherwise the child process will run forever. If the process has handle 1024 requests, it will die and apache can stat a new process if needed

httpd.conf: MaxRequestsPerChild 1024

In the $OC4J_HOME/j2ee/home/config/transaction-manager.xml file you set the global transaction timeout with the transaction-timeout attribute of the <transaction-manager> element. For example, if you wanted to set the global transaction timeout to 1800 seconds, you would do as follows: <transaction-manager ... transaction-timeout="1800"
...
</transaction-manager>


Useful links:

15 comments:

Anonymous said...

A real Good Stuff!!
Ved

Anonymous said...

We get the following error multiple times:
ORABPEL-05243

Cannot obtain lock for process.
Failed to obtain load lock for process "RegisterSmartcardsForClientAdapter-1.0"; exception

Marc Kelderman SOA Blog said...

It looks like a proces is running and you want to deploy the same version. is this process polling? subscribed on aqueue? You could retire and suspend the process, then redeploy and enable them. Or you could deploy a new version of the process.

Anonymous said...

Its on the production Server and clueless as to why this occurs and its solution...

Anonymous said...

We are also getting the same error, any specific reason to this occurence. And any resolution please.

Ashutosh

Marc Kelderman SOA Blog said...

Did you all increase the global transaction time-out?

In the [OC4J_HOME]/j2ee/home/config/transaction-manager.xml file you set the global transaction timeout with the transaction-timeout attribute of the <transaction-manager> element.

For example, if you wanted to set the global transaction timeout to 180 seconds, you would do as follows:

<transaction-manager ... transaction-timeout="180"
...
</transaction-manager>

Anonymous said...

Hi Marc

I'm developing various ESB systems to my company as part of a big project...

These ESB systems use File Adapter or DB Adapter for Input, and an AQ Adapter for Output

I've test them with testing data, but I'm worried about the performance in production enviroment because in this enviroment we have to transfer aprox. 13000000 records per day

Please I need information about tuning an ESB System, and maybe you are de right person or maybe know where or how I can get info about that...

Thanks in advance

Marc Kelderman SOA Blog said...

I suggest to setup an test environment to do performance tests. I expect that you will run into high CPU usage. Make sure that ESB has enough memory to process. Tune your DB adapter that is has enough connection to the database.

Anonymous said...

Nice article. Is there a way to configure this using oracle's "Application Server Control" web interface?

if so would it be under
Cluster Topology > Application Server: ip.com > OC4J: oc4j_soa >
/ Administration...

but which TaskNames would be appropriate.

Thank you.

Erik Ykema (Utrecht) said...

Hi Marc,
Thanks for this nice blog post. We are considering Oracle Soa Suite as our integration middleware, but keep hearing rumours about stability and performance.
As you have considerable real-life experience, would you mind sharing your opinion on this subject?
Regards, Erik Ykema (Utrecht)

Marc Kelderman SOA Blog said...

Erik,

I do not known who told you the rumours. But the product en dev tools are stable. I've been working with SOA Suite for a few years.
And, as in every software product, you have bugs. But not all the bugs do have impact on your environment. Periodically, Oracle is creating patch-sets. Currently patch set #9 is out.

Marc

If you have questions,contact me at marc.kelderman at oracle.com

Anonymous said...

I try to send XML document using utl_dbws to external web service using utl_dbws but didn't work.
Is posible you send me instructions to consumig that web service (http://art-qa-gtw.artikos.cl/pruebaconsalud/AtkWs_DocConnector.asmx).

Thanks for you help.
(adia@code.com.ar)

Anonymous said...

I try to send XML document using utl_dbws to external web service using utl_dbws but didn't work.
Is posible you send me instructions to consumig that web service (http://art-qa-gtw.artikos.cl/pruebaconsalud/AtkWs_DocConnector.asmx).

Thanks for you help.
(adiaz@code.com.ar)

ashraf said...

Hi Buddy

If i set dspMaxthreads=0. Does that mean it will take infinite request or no request

Thanks
Ashraf

tjain said...

I have published a brief summary of parameters of SOA Suite for tuning purpose. It might be useful for you.

http://oracle-fusion-middlware.blogspot.com/

Tushar

Post a Comment

Post a Comment