...
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.
...
Configure the BPS datasource by editing the <BPS_HOME>/repository/conf/datasources/bps-datasources.xml
file and changing the maxActive value .
.
Code Block | ||
---|---|---|
| ||
<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
Activiti BPMN engine uses 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.
...
Code Block | ||
---|---|---|
| ||
<datasources> <datasource> <name>ACTIVITI_DB</name> <description>The datasource used for activiti engine</description> <jndiConfig> <name>jdbc/ActivitiDB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://localhost:3306/activity<activitiDS</url> <username>root</username> <password>root</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource> </datasources> |
...
Code Block |
---|
<tns:odeschedulerthreadpoolsize>50</tns:odeschedulerthreadpoolsize> |
...
Multi-threaded HTTP connection manager
...
Code Block | ||
---|---|---|
| ||
<tns:WSO2BPSxmlnsWSO2BPS xmlns:tns="http://wso2.org/bps/config"> ... <tns:MultithreadedHttpConnectionManagerConfig> <tns:maxConnectionsPerHostvaluemaxConnectionsPerHost value="100"/> <tns:maxTotalConnectionsvaluemaxTotalConnections 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.
...
Code Block | ||
---|---|---|
| ||
<tns:ProcessDehydration maxCount="100" value="true"><tns:MaxAgevalueMaxAge value="300000"/></tns:ProcessDehydration> |
MaxAgevalue
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.
...
Code Block | ||
---|---|---|
| ||
<processname<process name="pns:HelloWorld2"> <in-memory>true</in-memory> <provide <providepartnerLinkpartnerLink="helloPartnerLink"> <service <servicenamename="wns:HelloService" port="HelloPort"/> </provide> </process> |
...
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.
...