Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56376

remoting kakfa plugin creates too many threads and takes too much cpu time

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • remoting-kafka-plugin
    • None
    • Jenkins-2.165
      remoting-kafka-1.1.3

      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.

            pvtuan10 Pham Vu Tuan
            fnaum Federico Naum
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: