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

Jacoco plugin is too slow and occupies too much microprocessor time

    XMLWordPrintable

Details

    Description

      Plugin hangs up pretty much time and top/htop shows up that jenkins is using too much CPU time.

      Attachments

        Activity

          I noticed similar issue with one of our Jenkins servers

          iliam Ilia Meerovich added a comment - I noticed similar issue with one of our Jenkins servers

          OK, I made a little investigation.
          It seems that serialization/de-serialisation in https://github.com/jenkinsci/jacoco-plugin/blob/master/src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java
          takes a lot of cpu, also load doesn't not spread evenly on all cores (I used htop).
          In our case I'm speaking about ovirt project (~3800 classes).
          iftop doesn't shows significant network traffic and iostat also doesn't shows significant load.
          So analyse of the same jacoco.exec file on idle jenkins taking 30-50 seconds, but on production jenkins it can take 30-50 minutes.

          iliam Ilia Meerovich added a comment - OK, I made a little investigation. It seems that serialization/de-serialisation in https://github.com/jenkinsci/jacoco-plugin/blob/master/src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java takes a lot of cpu, also load doesn't not spread evenly on all cores (I used htop). In our case I'm speaking about ovirt project (~3800 classes). iftop doesn't shows significant network traffic and iostat also doesn't shows significant load. So analyse of the same jacoco.exec file on idle jenkins taking 30-50 seconds, but on production jenkins it can take 30-50 minutes.
          seanf Sean Flanigan added a comment -

          This discussion might be relevant to the slow serialisation of .exec files: https://groups.google.com/d/topic/jacoco/4f0rf3zqYKY/discussion

          seanf Sean Flanigan added a comment - This discussion might be relevant to the slow serialisation of .exec files: https://groups.google.com/d/topic/jacoco/4f0rf3zqYKY/discussion

          We are also seeing issues where the plugin uses too much CPU and virtual memory on our Oracle Linux 6.4 server.

          afowleswinkler Anna Fowles-Winkler added a comment - We are also seeing issues where the plugin uses too much CPU and virtual memory on our Oracle Linux 6.4 server.
          seanf Sean Flanigan added a comment -

          The class mentioned by iliam is using unbuffered I/O, so I've added a BufferedInputStream: https://github.com/jenkinsci/jacoco-plugin/pull/78

          I'm having trouble reproducing the original performance problem, so I haven't seen much difference so far. But perhaps it will help with CPU utilisation when Jenkins is under load. Feedback welcome!

          seanf Sean Flanigan added a comment - The class mentioned by iliam is using unbuffered I/O, so I've added a BufferedInputStream: https://github.com/jenkinsci/jacoco-plugin/pull/78 I'm having trouble reproducing the original performance problem, so I haven't seen much difference so far. But perhaps it will help with CPU utilisation when Jenkins is under load. Feedback welcome!

          Code changed in jenkins
          User: Sean Flanigan
          Path:
          src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java
          http://jenkins-ci.org/commit/jacoco-plugin/ff66560910e884f10927f3b07e61f24f52d5e2cc
          Log:
          JENKINS-26254 Use BufferedInputStream to read .exec files

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Sean Flanigan Path: src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java http://jenkins-ci.org/commit/jacoco-plugin/ff66560910e884f10927f3b07e61f24f52d5e2cc Log: JENKINS-26254 Use BufferedInputStream to read .exec files

          Code changed in jenkins
          User: Dominik Stadler
          Path:
          src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java
          http://jenkins-ci.org/commit/jacoco-plugin/a35ce7309e4ca289bb6045000c400d99e36f4ccf
          Log:
          Merge pull request #78 from seanf/JENKINS-26254-use-buffer

          JENKINS-26254 Use BufferedInputStream to read .exec files

          Compare: https://github.com/jenkinsci/jacoco-plugin/compare/c6bf58a4b9d8...a35ce7309e4c

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Dominik Stadler Path: src/main/java/hudson/plugins/jacoco/ExecutionFileLoader.java http://jenkins-ci.org/commit/jacoco-plugin/a35ce7309e4ca289bb6045000c400d99e36f4ccf Log: Merge pull request #78 from seanf/ JENKINS-26254 -use-buffer JENKINS-26254 Use BufferedInputStream to read .exec files Compare: https://github.com/jenkinsci/jacoco-plugin/compare/c6bf58a4b9d8...a35ce7309e4c
          centic centic added a comment -

          I am closing this for the 2.2.0 release, please report new issues if you still have issues when running with that version of the plugin.

          centic centic added a comment - I am closing this for the 2.2.0 release, please report new issues if you still have issues when running with that version of the plugin.

          People

            ognjenb Ognjen Bubalo
            borzh Borzh Borzhovich
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: