Skip to content

High CPU usage for NiFi Cluster due to operator controllers calls #537

Open
@ggerla

Description

@ggerla

What steps will reproduce the bug?

I'm using nifikop to deploy a nifi cluster with 4 nifi nodes and 3 zookeper nodes.
I discovered that the nifi cluster is consuming between 7x to 10x times the cpu.
Looking to logs and statistics I found that the operator is doing a lot of calls to NiFi APIs and this generates the CPU consumption.
The main issue is that all these API calls are done during the reconcile loop with a frequency that is quite aggressive.

Killing the operator the CPU usage is collapsing
Image

What is the expected behavior?

A Nifi Cluster with 4 nodes in idle usually consumes around 0,5 cpus

Image

What do you see instead?

The same cluster with the operator consumes between 3 CPU and 5 CPU

Image

Possible solution

Try to distinguish between a reconcile rerun during a the setup phase and the reconceile run interval during "idle" state, so that you can relax the frequancy of API calls during in idle state

NiFiKop version

v1.10.0

Golang version

1.19

Kubernetes version

v1.26.0

NiFi version

1.27.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions