This section explains how to tune parameters that control the performance of ESB Analytics when it is affected by high loads, network traffic etc. These parameters should be tuned based on the deployment environment.
Tuning carbon.xml parameters
When a batch of data is processed and published to the Analytics dahsboard, the ESB idles for a defined time interval before processing another batch of data. This is to ensure that too much data will not be stored in Analytics at a given time. By default, the ESB idles for 5000 milliseconds (5 seconds).
If you want to change the default indle time, add the following configuration to the <ESB_HOME>/repository/conf/carbon.xml
file and specify the required idle time interval.
<MediationFlowStatisticConfig> <StatWorkerIdleInterval></StatWorkerIdleInterval> </MediationFlowStatisticConfig>
The parameter used in the above configuration is explained below.
Parameter | Description | Tuning Recommendation |
---|---|---|
StatWorkerIdleInterval | The number of milliseconds that should elapse after a batch of statistical data is processed (to be published in the Analytics Dashboard) before sending another batch. | The default recommendation is 5000 milliseconds (i.e. 5 seconds). Therefore, your ESB is tuned to this value by default. When WSO2 ESB is handling a high load of requests, this value can be reduced to increase the frequency with which the resulting statistics are published in the Analytics Dashboard. This helps to avoid storing too much data in the ESB server causing an overconsumption of memory. When the load of requests handled by the ESB is comparatively low, this time interval can be increased to reduce the system overhead incurred by frequent processing. |
Tuning data-agent parameters
The parameters in the <ESB-HOME>/repository/conf/data-bridge/data-agent-config.xml
file can be tuned as follows.
Parameter | Description | Default Value | Tuning Recommendation | |
---|---|---|---|---|
QueueSize | The number of messages that can be stored in the ESB server at a given time before they are sent to be published in the Analytics Dashboard. | 32768 | This value should be increased when the ESB Analytics server is busy due to a request overload or if there is high network traffic. This prevents the generation of the When the ESB Analytics server is not very busy and when the network traffic is relatively low, the queue size can be reduced to avoid an overconsumption of memory. The number specified for this parameter should be a power of 2. | |
BatchSize | The ESB statistical data sent to the ESB Analytics server to be published in the Analytics Dashboard are grouped into batches. This parameter specifies the number of requests to be included in a batch. | 200 | This value should be tuned in proportion to the volume of requests sent from the ESB server to the ESB Analytics server. This value should be reduced if you want to reduce the system overhead of the ESB Analytics server. This value should be increased if the ESB server is generating a high amount of statistics and the QueueSize cannot be further increased without causing an overconsumption of memory. | |
CorePoolSize | The number of threads allocated to publish ESB statistical data to the Analytics Dashboard via Thrift at the time the ESB server is started. This value increases when the throughput of statistics generated increases. However, the number of threads will not exceed the number specified for the MaxPoolSize parameter. | 1 | The number of available CPU cores should be taken into account when specifying this value. Increasing the core pool size may improve the throughput of statistical data published in the Analytics Dashboard, but latency will also be increased due to context switching. | |
MaxPoolSize | The maximum number of threads that should be allocated at any given time to publish ESB statistical data in the Analytics Dashboard. | 1 | The number of available CPU cores should be taken into account when specifying this value. Increasing the maximum core pool size may improve the throughput of statistical data published in the Analytics Dashboard, since more threads can be spawned to handle an increased number of events. However, latency will also increase since a higher number of threads would cause context switching to take place more frequently. |