AutoBrowser Feature Can Cause Performance Issues

Article ID:232312088
1 minute readKnowledge base

Issue

  • Jenkins is getting slow

  • Many threads/slow requests trying to guess SCM browser:

    hudson.model.Items.getAllItems(Items.java:353)
    jenkins.model.Jenkins.getAllItems(Jenkins.java:1444)
    hudson.scm.AutoBrowserHolder.infer(AutoBrowserHolder.java:77)
    hudson.scm.AutoBrowserHolder.get(AutoBrowserHolder.java:64)
    hudson.scm.SCM.getEffectiveBrowser(SCM.java:136)
  • For Pipeline Jobs, the slow request would look like the following:

[number]msec elapsed in Handling GET /master/job/myrepo/job/master/wfapi/runs from 127.0.0.1 : RequestHandlerThread[#123]
    [...]
    hudson.model.Items.getAllItems(Items.java:353)
    jenkins.model.Jenkins.getAllItems(Jenkins.java:1444)
    hudson.scm.AutoBrowserHolder.infer(AutoBrowserHolder.java:77)
    hudson.scm.AutoBrowserHolder.get(AutoBrowserHolder.java:64)
    hudson.scm.SCM.getEffectiveBrowser(SCM.java:136)
    org.jenkinsci.plugins.workflow.job.WorkflowRun.getChangeSets(WorkflowRun.java:677)

Explanation

If no Repository Browser has been specified in the SCM configuration and no default repository browser exists, Jenkins searches for similar projects in the system to infer the browser. This is inefficient because it requires a permission check for each item. It can cause performance issues, especially for large instances.

Resolution

Upgrade to either the 2.7.3 LTS or the 2.7.19.x CloudBees fixed releases.

References