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 The following are the key points to note:.
Table of Contents | ||||
---|---|---|---|---|
|
OS-level settings
To optimize network and OS performance, configure the following settings in
/etc/sysctl.conf
file of Linux. These settings specify a larger port range, a more effective TCP connection timeout value, and a number of other important parameters at the OS-level.Info It is not recommended to use
net.ipv4.tcp_tw_recycle = 1
when working with network address translation (NAT), such as if you are deploying products in EC2 or any other environment configured with NAT.Code Block net.ipv4.tcp_fin_timeout = 30 fs.file-max = 2097152 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.core.rmem_default = 524288 net.core.wmem_default = 524288 net.core.rmem_max = 67108864 net.core.wmem_max = 67108864 net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 net.ipv4.ip_local_port_range = 1024 65535
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.
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
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 | ||
---|---|---|
| ||
-DentityExpansionLimit=100000 |
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.
...
Code Block | ||
---|---|---|
| ||
<tns:WSO2BPSxmlns:tns="http://wso2.org/bps/config"> ... <tns:MultithreadedHttpConnectionManagerConfig><tns:maxConnectionsPerHostvalue="20"/><tns:maxTotalConnectionsvalue="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:MexTimeOut value="600000"/>
<tns:ExternalServiceTimeOut value="600000"/> |
Code Block | ||||
---|---|---|---|---|
| ||||
<transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
<parameter name="PROTOCOL">HTTP/1.1</parameter>
<parameter name="Transfer-Encoding">chunked</parameter>
<!-- This parameter has been added to overcome problems encounted in SOAP action parameter -->
<parameter name="OmitSOAP12Action">true</parameter>
<parameter name="SO_TIMEOUT">600000</parameter>
<parameter name="CONNECTION_TIMEOUT">600000</parameter>
</transportSender> |
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.
Enable HumanTask caching in the <BPS_HOME>/repository/conf/humantask.xml
file.
Code Block | ||
---|---|---|
| ||
<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.
Configure this value in the <BPS_HOME>/repository/conf/humantask.xml
file.
Code Block | ||
---|---|---|
| ||
<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.
...