Timer and event driven thread pools

Learn about timer and event driven thread pools and how to configure them to optimize data flow performance.

There are two thread pools in NiFi:

  • Event Driven Thread Pool
  • Timer Driven Thread Pool

Event driven thread pool sizing strategy

The Event Driven strategy is an experimental feature and should not be used in production. You can change the associated value to 0.

Timer driven thread pool sizing strategy

The Timer Driven Thread Pool size is set to 10 by default. This number is the pool size per node in a NiFi cluster. If you have a 3-node cluster, you would have 30 threads available across the cluster.

This thread pool represents the threads that NiFi components can use to perform the processing they are supposed to do. Threads are distributed across all the components and allow the data flows to run with shared resources in the following logic. Based on the “run scheduling” configuration of the processor, the processor’s tasks get scheduled and each task asks for a thread to perform its work. The thread request goes in a queue, and as soon as a thread is available, the processor will get access to the thread, run its work and release the thread in the pool.

The components in NiFi are designed to run simple processing very efficiently, so processors usually do not keep a thread for a long time. There are exceptions with specific processors, or when processing a huge file.