Support Questions

Find answers, ask questions, and share your expertise

Stop Nifi processor automatically

avatar
Explorer

Hi,

 

Is there any way that Nifi processors stop automatically after no input for example 10 minutes rather than running until they are manually stopped?

Kindly let me know if there is any such feature..

3 ACCEPTED SOLUTIONS

avatar

@krishna123 NiFi data flows are expected to be operated in an always on capacity.  If no input is arriving, the processor is not doing anything, there is no reason to stop it.

 

Can you explain in more detail why you want it actually stopped?

 

View solution in original post

avatar

@krishna123 this is how nifi is supposed to work.   If there is no input, even though the processor is Play/Green, it is not doing anything.     It is only "running" if there is input.

View solution in original post

avatar
Master Mentor

@krishna123 @jameswookyz @rafy 

NiFi processor are configured with a Run Schedule, by default processors are configured with a Run Schedule of 0 secs.  This tells NiFi core to schedule this processor to execute as often as possible.  The Scheduling part of the processor handles checking if any of the inbound connections to the processor with queued data or last execution resulted in data.
If there is no inbound queued FlowFiles, the NiFi controller will yield the processor scheduling.  This yielding is designed to prevent the processor from just constantly trying to schedule when there is no work to do. If there is work to do, the processor will get scheduled to execute.

The scheduling typically consumes microseconds of CPU time.  And the built-in yielding prevents excessive cpu usage when no work exists to execute upon.  Adjusting the run schedule does not change behavior of yielding, but when flow is constant for periods of time, changing the run schedule alters the throughput performance. 

Hope this clarifies things.

If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt

View solution in original post

6 REPLIES 6

avatar

@krishna123 NiFi data flows are expected to be operated in an always on capacity.  If no input is arriving, the processor is not doing anything, there is no reason to stop it.

 

Can you explain in more detail why you want it actually stopped?

 

avatar
Explorer

@steven-matison  Even if there is no input arriving the processor keeps in green running status know. Is it possible to stop it automatically after there is no input for example 10 minutes without any human intervention?

avatar
Contributor

The only thing i guessed you can do is to increase "Run schedule" time so the processor will not be looking for what to do all the time but will run  at the Run schedule time interval you specified.

 

avatar

@krishna123 this is how nifi is supposed to work.   If there is no input, even though the processor is Play/Green, it is not doing anything.     It is only "running" if there is input.

avatar
New Contributor

Can you explain in more detail?

avatar
Master Mentor

@krishna123 @jameswookyz @rafy 

NiFi processor are configured with a Run Schedule, by default processors are configured with a Run Schedule of 0 secs.  This tells NiFi core to schedule this processor to execute as often as possible.  The Scheduling part of the processor handles checking if any of the inbound connections to the processor with queued data or last execution resulted in data.
If there is no inbound queued FlowFiles, the NiFi controller will yield the processor scheduling.  This yielding is designed to prevent the processor from just constantly trying to schedule when there is no work to do. If there is work to do, the processor will get scheduled to execute.

The scheduling typically consumes microseconds of CPU time.  And the built-in yielding prevents excessive cpu usage when no work exists to execute upon.  Adjusting the run schedule does not change behavior of yielding, but when flow is constant for periods of time, changing the run schedule alters the throughput performance. 

Hope this clarifies things.

If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt