Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
maxLevel3
minLevel3

OS-level settings

  1. To alter the number of allowed open files for system users, configure the following settings in /etc/security/limits.conf file of Linux (be sure to include the leading * character).

    Code Block
    * soft nofile 4096
    * hard nofile 65535

    Optimal values for these parameters depend on the environment.

  2. To alter the maximum number of processes your user is allowed to run at a given time, configure the following settings in  /etc/security/limits.conf file of Linux (be sure to include the leading * character). Each carbon server instance you run would require up to 1024 threads (with default thread pool configuration). Therefore, you need to increase the nproc value by 1024 per each carbon server (both hard and soft).

    Code Block
    * soft nproc 20000
    * hard nproc 20000

JVM-level settings

  1. If one or more worker nodes in a clustered deployment require access to the management console, you would need to increase the entity expansion limit as follows in the <BPS_HOME>/bin/wso2server.bat file (for Windows) or the <BPS_HOME>/bin/wso2server.sh file (for Linux/Solaris). The default entity expansion limit is 64000.

    Code Block
    languagexml
    -DentityExpansionLimit=100000
    Tip

    Tip: This is not included by default in the wso2server.sh file. You must add this in explicitly.

  2. Memory allocated for the BPS can be increased by modifying <BPS_HOME>/bin/wso2server.bat file (for Windows) or the <BPS_HOME>/bin/wso2server.sh file (for Linux/Solaris). 
    • Default setting for WSO2 ESB 4.6.0 and later is: -Xms256m -Xmx512m -XX:MaxPermSize=256m
    • This can be changed for benchmarking as shown in the following example: -Xms2048m -Xmx2048m -XX:MaxPermSize=1024m (for Java 7) or -Xms2048m -Xmx2048m (for Java 8)

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 three engines; Apache ODE BPEL processor, HumanTask engine and Activiti BPMN engine. These 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 datasource configurations. 

BPS Datasource 

Both Apache ODE BPEL processor and HumanTask 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.

...

Code Block
languagexml
  <datasources>
        <datasource>
            <name>BPS_DS</name>
            <description></description>
            <jndiConfig>
                <name>bpsds</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:mysql://localhost:3306/bpsds</url>
                    <username>root</username>
                    <password>root</password>
                    <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                    <useDataSourceFactory>false</useDataSourceFactory>
                    <defaultAutoCommit>true</defaultAutoCommit>
                    <maxActive>100</maxActive>
                    <maxIdle>20</maxIdle>
                    <maxWait>10000</maxWait>
                </configuration>
            </definition>
        </datasource>
    </datasources>

 

Activiti Datasource 

Execution of each BPMN process instance makes multiple database calls. Therefore, when executing multiple process instances by concurrent threads (i.e., users), multiple database connections are used. Accordingly, the database connection pool has to be configured to provide the required number of connections based on the expected maximum concurrent process executions. This can be configured by setting the maxActive parameter of the <BPS_HOME>/repository/conf/datasources/activiti-datasource.xml file. To avoid failures that may occur due to the congestion for db connections, maxActive should be equal to the expected number of concurrent process executions. However, lesser number of connections may be sufficient depending on the properties of executed process models (i.e., number/type of tasks) and the behavior of processes (i.e. presence of timer events, reaction time of process participants). If db connection pool size (i.e. maxActive) has to be reduced, it has to be done based on load tests with actual process models and expected process behaviors.

...

Note

Also note that, even you have allocated higher number of database connections for datasources, 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.

ODE scheduler threads

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

...

Code Block
<tns:ODESchedulerThreadPoolSize>50</tns:ODESchedulerThreadPoolSize>

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. This is necessary when you have a lot of internal or external service invocations.

...

Code Block
languagehtml/xml
<tns:WSO2BPS xmlns:tns="http://wso2.org/bps/config">
    ...
    <tns:MultithreadedHttpConnectionManagerConfig>
        <tns:maxConnectionsPerHost value="100"/>
        <tns:maxTotalConnections value="200"/>
    </tns:MultithreadedHttpConnectionManagerConfig>
    ...
</tns:WSO2BPS>

TimeOuts

This configuration is relevant when partner services take more time to response. When partner services are slow or take more time to response, callee BPEL process's invoke activity fails due to message exchange timeout. By increasing time will avoid these kind of failures. Also note that, slow partner services will slow entire BPEL process. This will cause to timeout the client application. Thus it is required increase timeout interval for client application. To do this, configure the <BPS_HOME>/repository/conf/bps.xml file and the <BPS_HOME>/repository/conf/axis2/axis2.xml file as shown below.

...

Here you must increase the default values for message exchange timeout and external service invocation timeout. Also set the SO_TIMEOUT parameter and CONNECTION_TIMEOUT parameter in HttpSender. Increase the timeout value from the default value to 10 minutes.

 

HumanTask caching

HumanTask caching is important when you have to deal with a large user store. HumanTasks are tightly coupled with users and user roles/groups. Because of this, BPS does lot of user store lookups for HumanTask operations. These user store calls can take considerable amount of time, if the user store is large or located remotely. This degrades the performance of the entire HumanTask engine. Caching user and role lookup data at the BPS side will reduce these remote user store calls and improve the overall performance of the HumanTask engine.

...

Code Block
languagexml
<cacheconfiguration>
	<enablecaching>true</enablecaching>
</cacheconfiguration>

Number of HumanTask scheduler threads

This is relevant when you are not using HumanTask deadline/escalation. HumanTask deadline and escalation are scheduled tasks that are executed by the HumanTask scheduler. By default, 50 threads are allocated for the HumanTask scheduler. If you are not using deadline/escalations, you can configure this value to a lower value such as 5. This will utilize idle threads in BPS server. Note that, you can't set this to 0, because the HumanTask engine has several internal scheduled tasks to run.

...

Code Block
languagexml
<schedulerconfig>
	<maxthreadpoolsize>5</maxthreadpoolsize>
</schedulerconfig>

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 the <BPS_HOME>/repository/conf/bps.xml file or define a custom hydration/dehydration policy.

...

  • MaxAge value: Sets the maximum age of a process before it is dehydrated.
  • ProcessDehydration maxCount: 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.

...

Info

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.

BPMN performance tuning

The BPMN runtime frequently accesses the database for persisting and retrieving process instance states. Therefore, performance of BPMN processes depends heavily on the database server. In order to get best performance, it is recommended to have a high speed network connection between BPS instances and the database server.

...