Documentation / Pipelines

Analyzing a pipeline

Find bottlenecks in a deployed flow and apply suggested concurrency, yield and back-pressure changes.

Open Monitor, the tab of a deployed pipeline, then Analyze and press Analyze this pipeline. Run it while data is flowing through the pipeline: it uses the statistics the monitor collected in the last 5 minutes (at least about a minute of samples is needed) and reads the current settings of every processor and queue from NiFi™. Analysing changes nothing.

What it measures

MeasureHow
Time per FlowFileTask time of a processor divided by the FlowFiles it handled in the window.
Capacity usedTask time against the time its Concurrent Tasks could have worked, and the share of its threads that were busy.
Queue fullThe larger of the length and the size back-pressure percentages, as an average and peak, the share of samples at the limit, and whether the queue is growing.
BottleneckA busy processor with a half-full or growing queue in front of it that is not itself held up by a full queue after it. A full queue in front of a processor that is waiting on the next step is reported as a symptom, not a cause.

What it can suggest

SuggestionWhen
Concurrent Tasks of a processorIt is a bottleneck, supports parallel tasks and is below the limit (the number of CPUs of the NiFi server, at most 32). Doubled up to 4 tasks, then 2 more at a time.
Yield Duration of a processorRaised when it runs many tasks that find no work (at least 600 in 5 minutes, under 10 % with work). Lowered to 1 second when it sleeps long while work waits in front of it.
Back-pressure length of a queueRaised when the queue sits at its limit but the processor after it has capacity left. Lowered when the Java heap is over 85 % full and the limit is far above what the queue ever held.
Back-pressure size of a queueRaised when the data size, not the FlowFile count, fills the queue and the next processor has capacity (kept within a quarter of the free content repository). Lowered when the content repository is over 85 % full and the limit is far above the peak.

Notes appear when the cause is outside these settings: a processor held up by the step after it, an exhausted NiFi thread pool (Maximum Timer Driven Thread Count), a nearly full heap or repository.

Applying

Every suggestion has a tick box (all ticked). Pause, apply and restart asks for confirmation, then pauses the flow (tasks that are running finish first), writes each chosen setting to that one processor or queue, and starts the flow again if it was running. A flow that was stopped stays stopped. Before each change the current value is compared with the one analysed; a component that was changed in the meantime is skipped and reported. The change applies to this deployment only; other deployments of the same flow keep their own settings. Each application is written to the audit log with the old and new values.

Note

Limits. The figures are NiFi's 5-minute statistics, so a flow that has been running for less than 5 minutes, or a burst that came and went, can mislead: analyse under typical load and judge the suggestions. Starting the flow again starts every component that can run, as the Start button does. Suggestions are heuristics, not a guarantee of faster processing; analyse again a few minutes after applying to see the effect. A suggestion list is kept for 30 minutes and is lost when the suite restarts.