Only discovered when I moved to the production environment that the server and client side of this plugin are taking too much user CPU time. I think it is because the large number of threads (hopefully unnecessary) it spawns. Also, it might be consuming unnecessary memory.
In the agent side, even when there are no jobs assigned it consumes a full cpu, and create about 30-40 threads. A naive thought is telling me that we should open as many threads as the number of executors the agent is configured with.
On the server side, when I have about 8-10 kafka agent nodes it takes ~7 cpus (of my 8 cores), with kafka Channel reader threads that are opened for the agents.
In addition to the 54 threads that are created for the kafka-producer-network thread
In my test Jenkins instance, I observed the creation of 900+ threads
I tested with the inside the docker container that is provided with the plugin and also observed it creates a high number of threads.
I'll upload some screenshots.