# A Data Processing and Distribution System Based on Apache NiFi
## 5 Research and Results
### Three Nodes  
A cluster composed of three nodes was able to process the data three times more than a single-node cluster. This performance improvement proved the ability of Apache NiFi to horizontally scale. In both the optimized and default configurations, the mean value of the load average was slightly decreased compared to that in the single-node scenario.  
Additionally, the total CPU usage decreased by about 15 percentage points for the optimized configuration, whereas for the default configuration, it stayed on the same level (see Table 3). It is interesting that the confidence interval calculated for the load average parameter in the default configuration significantly decreased (see Figure 11). This suggests that the cluster operated under more stable conditions.  
Figure 11: Load average parameter as a function of the processing time of the input set (three nodes). Panel (**a**) shows the result of the optimized configuration, whereas (**b**) depicts the default configuration.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Node Number** & **CPU—User [\%]** & **CPU—System [\%]** & **RAM Used [MB].** \\  & & Four Nodes—Default Configuration & \\ \hline
1 & \(51.07\pm 10.71\) & \(27.35\pm 10.69\) & \(2865.79\pm 184.68\) \\
2 & \(50.44\pm 11.5\) & \(26.87\pm 11.08\) & \(2672.01\pm 231.48\) \\
3 & \(48.89\pm 14.16\) & \(26.89\pm 11.45\) & \(2644.76\pm 240.33\) \\
4 & \(36.89\pm 15.86\) & \(22.91\pm 11.2\) & \(2528.87\pm 326.95\) \\ average & \(46.82\pm 13.06\) & \(26.01\pm 11.1\) & \(2677.86\pm 245.86\) \\ \hline \hline \multicolumn{4}{c}{Five Nodes—Optimized Configuration} \\ \hline
1 & \(58.18\pm 18.88\) & \(13.36\pm 4.05\) & \(2939.28\pm 225.73\) \\
2 & \(57.75\pm 19.17\) & \(12.55\pm 3.35\) & \(2725.8\pm 247.69\) \\
3 & \(60.96\pm 17.13\) & \(12.85\pm 3.85\) & \(2734.32\pm 268.28\) \\
4 & \(59.38\pm 19.96\) & \(13.23\pm 4.38\) & \(2729.3\pm 261.57\) \\
5 & \(59.0\pm 18.81\) & \(13.79\pm 4.29\) & \(2736.59\pm 264.59\) \\ average & \(59.05\pm 18.79\) & \(13.15\pm 3.99\) & \(2773.06\pm 253.57\) \\ \hline \hline \multicolumn{4}{c}{Five Nodes—Default Configuration} \\ \hline
1 & \(41.58\pm 21.67\) & \(22.83\pm 13.6\) & \(2990.34\pm 183.84\) \\
2 & \(51.2\pm 10.69\) & \(22.58\pm 13.75\) & \(2666.11\pm 226.08\) \\
3 & \(47.91\pm 11.57\) & \(21.97\pm 13.17\) & \(2628.47\pm 23  
The average time required to obtain one result entry in the optimized configuration was reduced by about two times (from 102 to 57 s) compared to that in the standalone scenario. In contrast, the analogous parameter in the case of the default configuration was reduced by approximately 400 s from 1400. Detailed histograms are shown in Figure 12. Thus, the optimized configuration consequently achieved significantly better results (57 versus 1000 s on average).  
In the NiFi deployment for the commercial 5G network, the cluster also consisted of three nodes. We were unable to extract the raw data related to the load average due to the security policy. As a substitute, in Figure 13, we present the graphical results generated by NiFi. The average value of the load average across the production cluster was lower than that in our research environment. This was mostly due to hardware differences. The machines used during the research had only 4 GB of RAM and two CPU cores, while the operator's machines had 30 GB of RAM that were dedicated exclusively to NiFi and 20C/40T Intel Xeon Gold 6230N CPUs with an average clock rate of 2.3 GHz.  
Figure 12: Distribution of time required to extract a single cited article (three nodes). Panel (**a**) shows the result of the optimized configuration, whereas (**b**) depicts the default configuration.  
Figure 13: Load average extracted from the client configuration.