Search This Blog

Wednesday, January 11, 2012

Tuning the Oracle SOA infrastructure

Tuning the Oracle SOA infrastructure involves the following:

JVM Memory
JVM Garbage Collection
Datasources
Threads
EJB
Database
Tuning JVM Memory

The JVM Memory settings are extremely important for Oracle SOA 11g. Set the minimum heap size to 2048MB and the maximum heap size to 4096MB or more depending on the availability of your physical resources on which the SOA platform is installed.
Also, setting the PermSize and the MaxPermSize is extremely important. Make sure that the PermSize is set to at least 512MB and the MaxPerSize is at least 1024.

Example:
-Xms2048M -Xmx4096M -XX:PermSize=512M -XX:MaxPermSize=1024M

Setting JVM Garbage Collection

If your SOA Suite is running on a single CPU machine, then setting the garbage collection to parallel will not improve the performance. However, if your SOA Suite is installed on a virtual machine with a multi-core CPU running on a VMWare ESX host, then setting this option will improve your system’s performance significantly.

Example parameters for a multi-core CPU or virtualized environment server:
-XX:-UseParallelGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing

Tuning SOA Suite 11g DataSources

Configuring and optimizing your back-end connections for SOA Suite is essential for the overall system performance. Oracle recommends that you run a series of load tests against your database to adequately measure performance needs and properly define the associated parameters.

Oracle recommends to tune the below Oracle SOA 11g DataSources:

BAMDataSource
EDNDataSource
EDNLocalTxDataSource
mds-soa
SOADataSource
SOALocalTxDataSource

The following parameters settings showed improved performance over the default when set for each of the above datasources. These are set using the Weblogic Administrative Console:

Initial Capacity=0
Maximum Capacity=100
Capacity Increment=1
Statement Cache Type=LRU
Statement Cache Size=0
Test Connections On Reserve=TRUE
Test Frequency=180
Seconds to Trust an Idle Pool Connection=30
Shrink Frequency=300
Connection Creation Retry Frequency=30
Inactive Connection Timeout=30
Maximum Waiting for Connection=2147483647
Connection Reserve Timeout=30
Statement Timeout=-1
oracle.net.CONNECT_TIMEOUT=100000
Set XA Transaction Timeout=TRUE
XA Transaction Timeout=0
XA Retry Duration=300
XA Retry Interval=60

Threads

Oracle advises against modifying the default threading model for the Oracle SOA 11g Suite. This is because Weblogic uses an automated mechanism for tuning its execution of threads. WebLogic Server prioritizes the requests and allocates threads based on an execution model that takes into consideration the managed servers parameters and actual run-time statistics.
On the other hand, you may tune the threads of the BPEL engine itself. This can be achieved through the Weblogic Enterprise Manager. The threads will use a database connection from the pool.

Setting the following parameters according to Oracle’s best practices for the BPEL engine through EM will allow for an improved thread execution and handling:

dspInvokeThread=10
dspEngineThreads=15
dspSystemThreads=2
synMaxWaitTime=150

EJB

The soa-infra application includes all the EJB objects required for Oracle SOA 11g Suite. Each of these EJB objects has a pre-defined timeout setting. By default, this setting is 300 seconds. Time-out errors could occur in the case of long running processes that could slow down the overall SOA system. Therefore you should not just count on tuning the soa-infra application, you should design and implement efficient and optimal composites.
To change the timeout of the EJB’s, you will need to go through steps described below:
Log in to the Weblogic Administrative Console.
Undeploy the soa-infra application and activate the changes.
Redeploy soa-infra application with configuration file (Plan.xml) from $ORACLE_HOME/soa/applications/soa-infra-wls.ear with all the new EJB time-out settings. Make sure to copy the application to all servers.
Activate changes
Start soa-infra application to server all requests.

Please note the following timeout settings showed improved performance over the default:

TransactionDescriptor_transTimeoutSeconds_BPELEngineBean=1800
TransactionDescriptor_transTimeoutSeconds_BPELDeliveryBean=1800
TransactionDescriptor_transTimeoutSeconds_BPELActivityManagerBean=1800
TransactionDescriptor_transTimeoutSeconds_BPELServerManagerBean=1800
TransactionDescriptor_transTimeoutSeconds_BPELProcessManagerBean=1800
TransactionDescriptor_transTimeoutSeconds_BPELInstanceManagerBean=1800
TransactionDescriptor_transTimeoutSeconds_BPELFinderBean=1800
TransactionDescriptor_transTimeoutSeconds_BPELDispatcherBean=1800
TransactionDescriptor_transTimeoutSeconds_BPELSensorValuesBean=1800

In addition, verify that the global transaction timeout on all the managed servers is larger than the timeout of the EJB. If using the above settings, make sure to set the global transaction time-out, JTA, to 3600 through the Weblogic Administrative Console.

Database

Ensure first that you have followed the appropriate database configuration required for Oracle SOA 11g Suite as documented in the Oracle SOA 11g Administrative Guide (Download from oracle.com). Most importantly, make sure that the database is configured to create adequate processes and sessions to support the infrastructure. The database must be tuned so that it has enough memory for caching, PGA, and SGA.
In addition, cleaning the SOA composite instances from the back-end is also important as part of the Oracle SOA 11g system maintenance. Deleting thousands of instances with the Delete with Options button on the Instances page of a SOA composite application in Oracle Enterprise Manager takes time and may result in a transaction timeout and data inconsistency. Instead, Oracle recommends using the “purge_soainfra_oracle.sql” PL/SQL script for instance and rejected message deletion. The script can be located under: “SOA_HOME\rcu\integration\soainfra\sql\purge”. The PL/SQL procedures in this script are populated into the database when you run the Repository Creation Utility during Oracle SOA Suite schema creation.
For detailed instructions on how to use and manipulate the purging scripts to maintain the Oracle SOA suite, refer to Section 8.11 in the Oracle Fusion Middleware – Administrator’s Guide for Oracle SOA Suite and Oracle Business Process Management Suite.

The link for the administrative guide is provided below:
http://download.oracle.com/docs/cd/E14571_01/integration.1111/e10226.pdf