Previously, WSO2 recommended to set the value of the pool size to 100. However, we empirically found out that a pool size of zero gives the best all-round performance.
When you set the
<PoolSize> to zero, it applies to all three thread pools (
Make sure to set the
<PoolSize> to zero in order to avoid the following.
- Data inconsistencies - This might occur in case one node delays to update the database, but meanwhile other nodes access data from that database.
- Performance issue - Suppose there is a sudden load to an extent that all the three queues, i.e.,
SessionDataPersistTask are filled with data. If the thread pool is set to a value higher than zero, it will persist the data in the database concurrent with the size of the thread pool defined, utilizing all the database connections. This leads to other applications waiting for a database connection to complete its tasks.
The following sections guide you through the difference between these two approaches and how to configure them.