This documentation is for WSO2 Complex Event Processor 4.0.0. View documentation for the latest release.
WSO2 Complex Event Processor is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.

Versions Compared

Key

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

...

Table of Contents
maxLevel5
minLevel5

Receiving events

It is recommended to use WSO2Event as the receiver type to receive events with increased speed and as a result, achieve a greater throughput within a given duration of time. These configurations are common for both thrift and binary protocols.   

The following parameters which affect the performance relating to receiving events are configured in the <CEP_HOME>/repository/conf/data-bridge/data-bridge-config.xml file. These configurations are common for both thrift and binary protocols. 

PropertyDescriptionDefault ValueRecommendation
workerThreadsThe number of threads reserved to handle the load of events received.10This value should be increased if you want to increase the throughput by receiving a higher number of events at a given time. The number of available CPU cores should be considered when specifying this value. If the value specified exceeds the number of CPU cores, higher latency would occur as a result of context switching taking place more often.
eventBufferCapacityThe size of the event receiving buffer. This buffer temporarily stores the events received before they are forwarded to an event stream10000This value should be increased if you want to increase the throughput by receiving a higher number of events at a given time.
PropertyDescriptionRecommendation
workerThreads

Number of threads in consumer to handle the load. Default value is 10.

Value should be higher when receiving throughput is high. Should to consider number of CPU cores.
eventBufferCapacitySize of the receiving event buffer. Default value is 10000.Needs to be higher value when receiving throughput is high. When increasing the value heap memory size also needs to be increased accordingly.

...

The following parameters which affect the performance relating to publishing events are configured in the <CEP_HOME>/repository/conf/data-bridge/data-agent-config.xml file. These configurations are common for both thrift and binary protocols.

This is the queue disruptor. The default value is 32768. Value should be high when If you need low latency this value should be result at cost of low throughputShould consider number of CPU cores and value should be greater than CorePoolSize.
PropertyDescriptionDefault ValueRecommendation
QueueSizeThe size of the queue event disruptor which handles events before they are published to an application/data store.32768

The value specified should always be the result of an exponent with 2 as the base. (e.g., 32768 is 215).

A higher value should be specified when a higher throughput needs to be handled.

However, the increase in the load handled at a given time can reduce the speed at which the events are processed. Therefore, a lower value should be specified if you want to reduce the latency.

BatchSizeThe maximum size number of events in a batch . Default value is 200.
Should consider about throughput of events and sent to the queue event disruptor at a given time.
200This value should be assigned proportionally to the throughput of events handled. Greater the batch size, higher will be the number of events sent to the queue event disruptor at a given time.
CorePoolSizeReserved The number of threads . Default value is 1.Should consider number of CPU cores and value should be less than MaxPoolSize.MaxPoolSizeMaximum number of threads allowed. If load cannot be handled, threads will spin off up to MaxPoolSize. Default Value is 1.that will be reserved to handle events at the time you start the CEP server. This value will increase as throughput  of events handled increases, but it will not exceed the value specified for the MaxPoolSize parameter.1The number of available CPU cores should be taken into account when specifying this value. Increasing the core pool size may improve the throughput, but latency will also be increased due to context switching.
MaxPoolSizeThe maximum number of threads that should be reserved at any given time to handle events.1The number of available CPU cores should be taken into account when specifying this value. Increasing the maximum core pool size may improve the throughput 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.

For better througput you can configure the parameters as follows.

Code Block
<QueueSize>32768</QueueSize>
<BatchSize>200</BatchSize>
<CorePoolSize>1</CorePoolSize>
<MaxPoolSize>1</MaxPoolSize>

If you want to achieve better latency at cost of reduced throughput For reduced latency, you can configure the parameters as follows. 

Code Block
<QueueSize>256</QueueSize>
<BatchSize>200</BatchSize>
<CorePoolSize>1</CorePoolSize>
<MaxPoolSize>1</MaxPoolSize>