X4 Produktdokumentation

Configuring the Worker Thread Pool

The worker thread pool is used to centrally manage threads used internally by X4 BPMS, for example, through adapters and the Scheduler. To use the worker thread pool, a configuration file is required that is loaded at server startup.

To create the configuration file

  1. Open an editor, such as Notepad++.

  2. Create a new file with the following content.

    XML
    <Configuration>
        <CorePoolSize></CorePoolSize> 
        <MaximumQueueSize></MaximumQueueSize> 
        <MaximumPoolSize></MaximumPoolSize>  
        <KeepAliveTime></KeepAliveTime> 
        <KeepAliveTimeUnit></KeepAliveTimeUnit> 
    </Configuration>
    
  3. Name the file platform-worker-thread-pool.xml and save it to the <server_directory>/configurations/platform-worker-thread-pool.xml directory.

Note:

If this file does not exist in the configurations folder, X4 BPMS will revert to the default values:

XML
<Configuration>
    <CorePoolSize>10</CorePoolSize>          
    <MaximumQueueSize>100</MaximumQueueSize>  
    <MaximumPoolSize>100</MaximumPoolSize> 
    <KeepAliveTime>60</KeepAliveTime> 
    <KeepAliveTimeUnit>SECONDS</KeepAliveTimeUnit>
</Configuration>

The following elements are included in the configuration file:

Element

Description

Configuration

Root element of the configuration file

CorePoolSize

Number of threads that always exist in the pool

Possible values:

  • Any integer

  • 10 (default)

MaximumQueueSize

Maximum number of threads in the queue

Possible values:

  • Any integer

  • 100 (default)

MaximumPoolSize

Maximum number of threads in the pool

Possible values:

  • Any integer

  • 100 (default)

KeepAliveTime

Idle duration for threads outside CorePoolSize

Possible values:

  • Any integer

  • 60 (default)

KeepAliveTimeUnit

Time unit of idle duration for threads outside CorePoolSize

Possible values:

  • DAYS

  • HOURS

  • MINUTES

  • SECONDS

  • MICROSECONDS

  • NANOSECONDS


Recommendations for customization

  • Increase the MaximumPoolSize value if many processes are started at the same time or are running longer.

  • Make sure that you have sufficient RAM allocated to the JVM, as more threads require more memory.

  • If a RejectedExecutionException appears in the log, this indicates that the pool or queue size is too small. Adjust the values accordingly.