CloudBees Plugin Usage Plugin 2.0 slows down Controller Start Up

Issue

  • After installing CloudBees Plugin Usage Plugin 2.0 and restarting a Jenkins controller (formerly “master”) the web UI displays the “Please wait while Jenkins is getting ready to work” message for an unusually long period of time.

  • After upgrading a Jenkins controller (formerly “master”), the web UI displays the “Please wait while Jenkins is getting ready to work” message for an unusually long period of time.

  • When collecting a thread dump, we see a runnable thread like the following:

    "AnalyzerWork.initialize" #27 daemon prio=5 os_prio=0 tid=0x00007fa11837e000 nid=0x3e runnable [0x00007fa13577e000]
       java.lang.Thread.State: RUNNABLE
        at java.util.regex.Pattern.RemoveQEQuoting(Pattern.java:1596)
        at java.util.regex.Pattern.compile(Pattern.java:1689)
        at java.util.regex.Pattern.<init>(Pattern.java:1352)
        at java.util.regex.Pattern.compile(Pattern.java:1028)
        [...]
        at com.cloudbees.jenkins.plugins.pluginusage.v2.Analysis.fromJSON(Analysis.java:244)
        at com.cloudbees.jenkins.plugins.pluginusage.v2.Analysis.fromFile(Analysis.java:261)
        at com.cloudbees.jenkins.plugins.pluginusage.v2.analyzers.SnapshotAnalyzer.load(SnapshotAnalyzer.java:21)
        at com.cloudbees.jenkins.plugins.pluginusage.v2.analyzers.Analyzer.init(Analyzer.java:101)
        at com.cloudbees.jenkins.plugins.pluginusage.v2.AnalyzerWork.initialize(AnalyzerWork.java:44)
    
  • With start up performance logs enabled (see How to Troubleshoot and Address Jenkins Startup Performances), when Jenkins eventually starts the startup logs show that the AnalyzerWork.initialize had taken a very long time:

    INFO  jenkins.model.Jenkins$5#runTask: Took <timeInMillis>ms for AnalyzerWork.initialize by <threadName>
    

Environment

Related Issue(s)

  • FNDJEN-3360: Performance issue reading Plugins Usage Analysis file when starting the instance

Explanation

The CloudBees Plugin Usage Plugin version 2.0 initialization - AnalyzerWork.initialize task - reads an analysis report on start up that can take several minutes depending on the environment. This process is synchronous and Jenkins will not be fully loaded until it completes.

There is an issue that captured this problem FNDJEN-3360: Performance issue reading Plugins Usage Analysis file when starting the instance.

Resolution

Until FNDJEN-3360 is fixed and released, the workaround if impacted is to

Note: this issue is only a problem on start up. Another workaround is to remove the file $JENKINS/pup/analysis.json before starting / restarting Jenkins.

Have more questions?

0 Comments

Please sign in to leave a comment.