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
| Measure | How |
|---|---|
| Time per FlowFile | Task time of a processor divided by the FlowFiles it handled in the window. |
| Capacity used | Task time against the time its Concurrent Tasks could have worked, and the share of its threads that were busy. |
| Queue full | The 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. |
| Bottleneck | A 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
| Suggestion | When |
|---|---|
| Concurrent Tasks of a processor | It 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 processor | Raised 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 queue | Raised 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 queue | Raised 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.
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.