Thread Pool settings
These settings are done in the wrapper-safeq-cloud-server.conf file, which is a key configuration file used in conjunction with the application's execution wrapper. It contains various settings and parameters that govern the behavior and performance of the application. Among these settings are factors that determine the parallelism levels for different components of the application. This document explains the usage and customization of two such factors: balanced.factor
and remote-messaging.factor
.
Parallelism factors
Parallelism factors dictate the number of threads or concurrent processes used for specific tasks within the application. These factors are instrumental in optimizing resource utilization and improving overall performance.
balanced.factor
The balanced.factor
property determines the parallelism factor for balanced processing tasks within the application. Balanced processing typically involves tasks where the workload is evenly distributed across available resources.
remote-messaging.factor
The remote-messaging.factor
property determines the parallelism factor for tasks related to remote messaging functionalities. These tasks often involve communication with external systems or services over a network.
threadpools.Conversion
The threadpools.Conversion
property determines the size of the document conversion thread pool. When there is an expectation of a high volume of documents being converted directly on the secondary server, we recommend increasing this thread pool size to ensure efficient document processing. However, the number should never overreach the CPU cores available, because too many parallel conversions may cause the whole system to be slowed down.
Conversion of big files can consume up to 1GB of memory, so you must allocate enough memory on the secondary server for each conversion. Increase the memory availability or reduce the thread pool size accordingly.
Calculations for Balanced and Remote messaging thread pool
The value is calculated based on the available processors and the configured factors. The formula used for calculation is:
Runtime.getRuntime.availableProcessors * factor
Runtime.getRuntime.availableProcessors
returns the number of available processors in the system.factor
represents configuredbalanced.factor
andremote-messaging.factor
value from the system properties. If not explicitly set, it'll use default values.
Default values and limits
Default values are applied to the parallelism factors. These default values ensure reasonable performance and resource utilization under typical circumstances.
balanced.factor
: 8remote-messaging.factor
: 4Maximum Allowed Factor
: The parallelism-factor should be carefully chosen considering the available hardware resources and workload characteristics. The maximum allowed factor is 64, beyond which the thread pool size will not be increased.
Customization
You can customize the default parallelism factors by setting the system properties in the wrapper-safeq-cloud-server.conf file. This customization allows you to tailor the application's behavior to suit specific deployment environments and workload characteristics.
Suggested Thread pool Conversion Configuration
To ensure efficient document processing when there's a high volume of documents converted directly on the secondary server, we suggest using a thread pool size close to the CPU cores (CPU cores - 1) for document conversion:
wrapper.java.additional.<n>=-Dthreadpools.Conversion=7
Adjust the thread pool size (7 in this case for 8 CPU cores machine) based on the expected workload and system capabilities.
Property format
Property | Description |
---|---|
-Dbalanced.factor=<value> | Sets the parallelism factor for balanced processing tasks. |
-Dremote-messaging.factor=<value> | Sets the parallelism factor for tasks related to remote messaging. |
-Dthreadpools.Conversion=<value> | Sets the size of the document conversion thread pool. |
Example configuration
# Customized parallelism factors for balanced processing and remote messaging
wrapper.java.additional.<n>=-Dbalanced.factor=<value>
wrapper.java.additional.<m>=-Dremote-messaging.factor=<value>
wrapper.java.additional.<k>=-Dthreadpools.Conversion=32
Replace <n>, <m> and <k> with appropriate numerical values to denote the order of additional Java options in the wrapper-safeq-cloud-server.conf file.
Replace <value> with the desired integer representing the desired parallelism factor.