'NiFi difference between nifi.bored.yield.duration and Run Schedule for Processor

I am exploring the Apache NiFi, and got some questions on how the processor is getting scheduled,

By Default Run Schedule value of processor is set as 0 Sec. That means the processor will start as soon as data is available.

There is also one more Global property that is nifi.bored.yield.duration which is by default set as 10ms,

nifi.bored.yield.duration=10 millis – This property is designed to help with CPU utilization by preventing processors that are using the timer driven scheduling strategy from using excessive CPU when there is no work to do.

So what is the difference between Run Schedule and nifi.bored.yield.duration

  1. is it something like if run schedule is set as 0 sec then the processor will run every 10ms ?


Solution 1:[1]

The bored yield duration is more about checking for work to do. Generally you very rarely have to know/care about this property. The processor itself will never execute unless there is work to do (i.e. flow files in an incoming queue) AND the scheduling condition has been met. The only exception is if a processor is annotated with @TriggerWhenEmpty, then this overrides the restriction of having work to do, and it just executes according to the schedule regardless of whether flow files are available.

Solution 2:[2]

NiFi has a scheduling mechanism. CRON or timer driven. So you can schedule a processor to run every X time. If we scheduled our processors to run every 0 seconds(as defined by default), it wouldn't be running all the time.

NiFi has a property that makes the processor yield and basically prevents it from running for 10 ms(by default).The property is configurable in nifi.properties under the name “nifi.bored.yield.duration”.

Hope this answers your question.

You can refer this article : https://benyaakobi.medium.com/nifi-scheduling-a522a1c9e740

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bryan Bende
Solution 2 nbalodi