This documentation is for WSO2 Business Process Server 3.2.0. View documentation for the latest release.

Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

The default distribution of WSO2 BPS comes with an embedded H2 database as the BPEL engine's persistence storage along with other settings suitable for development environment. However, it is recommended that some of these configurations be changed when moving to production. Configuration setting may change depending on the number of requests BPS is going to handle per second, your auditing and monitoring requirements, performance requirements and nature of your processes.

Given below are the key points to note:

External database

Configure an external database server such as MySQL as the persistence storage instead of embedded H2 database. Although slight performance gains can be experienced when using simple BPEL processes with H2 database, it cannot handle multiple concurrent requests and complex processes with the same efficiency.

JDBC connections

JDBC connections are useful when your application requires high throughput.

BPS has two engines; Apache ODE BPEL processor and HumanTask engine. These two engines are tightly coupled with the database layer and their function is to persist instance data into the database. Thus, for BPS to function properly, you need to allocate enough database connections for BPS datasource. Both these engine share same BPS datasource and database connections so we generally recommend allocating 50% of database connections for each engine for an application running with both BPEL and HumanTask.

For example if you have a total 100 database connections for a BPEL and HumanTask application, you can use upto 50 database connections for the ODE engine and leave the rest of the database connections for HumanTask operations. If you have only BPEL in your application, you can allocate many more database connections for the ODE engine.

Also note that, even you have allocated higher number of database connections for the BPS datasource, performance may not increase as expected. One reason for this could be that there are not enough database sessions from the database side. If that is the case, you need to increase the number of database sessions from database side.

Configure the BPS datasource by editing the <BPS_HOME>/repository/conf/datasources.properties file and changing the following.

synapse.datasources.bpsds.validationQuery=SELECT 1 FROM DUAL
synapse.datasources.bpsds.dsName=bpsds
synapse.datasources.bpsds.maxActive=100
synapse.datasources.bpsds.maxIdle=20
synapse.datasources.bpsds.maxWait=10000 - See more at: http://tryitnw.blogspot.com/2014/05/wso2-bps-320-performance-tuning-know.html#sthash.UnATY5b5.dpuf

ODE scheduler threads

ODE scheduler threads are useful when your application requires high throughput.

In the ODE engine, every scheduler thread is associated with a db connection. So the rule of thumb is, number of ODE scheduler threads should be less than or equal to number of db connections allocated for ODE engine. Otherwise some threads may not work properly, because they can't acquire a db connections to work.  For example In BPEL + HumanTask scenario, if you have total 100 db connections, your can allocate 50 threads for ODE scheduler. This will guarantee that at a given time, only 50 db connections are acquired by ODE engine.

Multi-threaded HTTP connection manager

Configure 'multi-threaded Http connection manager' connection pool settings to suit your BPEL processes. Typically, the HTTP connection manager should be configured to be in sync with the concurrent HTTP connections in BPS.

There are two configurations in Http connection manager. One is 'max total connections' and other is 'max total connection per host'. These settings depend on the number of concurrent requests BPS needs to handle, and the number of external service calls per process instance. For example,

<tns:WSO2BPSxmlns:tns="http://wso2.org/bps/config">
    ...
    <tns:MultithreadedHttpConnectionManagerConfig><tns:maxConnectionsPerHostvalue="20"/><tns:maxTotalConnectionsvalue="200"/></tns:MultithreadedHttpConnectionManagerConfig>
    ...
</tns:WSO2BPS>

BPEL process persistence

Configuring BPEL process persistence is recommended. If a process is implemented in the request-response interaction model, use in-memory processes instead of persistence processes. This decision mainly depends on the specific business use-case.

Process-to-process communication

Use process-to-process communication. This reduces the overhead introduced by additional network calls, when calling one BPEL process from another deployed in the same BPS instance.

Event filtering

Configure event-filtering at process and scope level. A lot of database resources can be saved by reducing the number of events generated.

Non-visualized environments

Take precaution when deploying WSO2 BPS in virtualized environments. Random increases in network latencies and performance degradation have been observed when running BPS on VMs.

Process hydration and dehydration

One technique to reduce memory utilization of the BPS engine is process hydration and dehydration. User can configure the hydration/dehydration policy in $PRODUCT_HOME/repository/conf/bps.xml file or define a custom hydration/dehydration policy.

The following example enables the dehydration policy and sets the maximum deployed process count that can exist in memory at a particular time to 100. The maximum age of a process before it is dehydrated is set to 5 minutes.

<tns:ProcessDehydrationmaxCount="100"value="true"><tns:MaxAgevalue="300000"/></tns:ProcessDehydration>
  • MaxAgevalue: Sets the maximum age of a process before it is dehydrated.
  • ProcessDehydrationmaxCount: The maximum deployed process count that can exist in memory at a particular time.

In-memory execution

For performance purposes, a process can be defines as being executed only in-memory. This greatly reduces the amount of generated queries and puts far less load on the database. Both persistent and non-persistent processes can cohabit in WSO2 BPS.

Shown below is an example of declaring a process as in-memory simply by adding an in-memory element in the deploy.xml file.

<processname="pns:HelloWorld2"> 
    <in-memory>true</in-memory>
    <providepartnerLink="helloPartnerLink">
        <servicename="wns:HelloService"port="HelloPort"/>
    </provide>
</process>
In-memory executions put restrictions on the process and the process instances cannot be queried using the BPS Management API. Also, the process definition can only include a single receive activity (the one that will trigger the instance creation).

Configuration details for these optimizations vary in older BPS versions. Also, these optimizations are supported by Apache ODE, but configuration is different from WSO2 BPS.

  • No labels