BPEL Performance tips
Tips for Increasing BPEL Performance:
- Logging: Set Audit Level to Production
- Disable sensor and composite audit collection.(This may not be possible when BAM is being used. So, use JMS based BAM data insertion instead)
- Increase the Invoke Threads ( if there are more invokes than Callbacks), increase Engine Threads ( if there are lots of Asynchronous activities that create separate threads like onMessage,Alarm,Wait, etc)
- Set a small value for the AuditDetailThreshold so that large payloads are not loaded and replaced with link that gets from the dehydration store when the BPEL instance is inspected in EM
- Decrease incoming message persistence to the dehydration store by setting oneWayDeliveryPolicy to async.cache ( needs more memory ), or sync( provided the providers are fast). The default is async.persist which stores the payload in the dehydration store ( provided the payloads are really small and the database in tuned)
- Tune the Datasources Connection Pool. Keep warm threads.
- Set the timeout parameters such that syncMaxWaitTime < BPEL ejb timeout < JTA Timeout. Also, if there are Database Queries involved, set the Timeout to none so that this becomes same as the JTA Timeout.Also make sure that httpConnection and httpRead timeouts are set for service invocations to make sure slow providers cannot create hogging threads.
- If the BPEL Process does not contain any dehydrating activities like wait,onAlarm, onMessage, etc., keep the Service as transient via inMemoryOptimisation=true (requires more memory, make sure the payload is small) and set completionPersistPolicy = Faulted so that only faulted instances are dehydrated. Stateless Entity Services are good candidates for this.
- Use Events instead of request/response patterns wherever possible. The only exception is when there is a single transaction required between the requestor and the provider.
- Set activity idempotent= false. This has two benefits, an activity is not immediately dehydrated(requires more memory) so is faster, and secondly, on restart faulted activities are not retried automatically( this might actually create stress on the Application). Transient services are a good fit for this setting.
- Use nonBlockingInvoke = true for achieving correct parallelism in flow activities.
- Tune mediator parallel worker threads and use parallel routes if possible.
- Wherever possible, use small invoke payloads.
- If there is an OSB Façade , use throttling and load balancing. Also, set the Accept Backlog Parameter to a higher values with load balancing turned on.