AutoBrowser Feature Can Cause Performance Issues

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)

Environment

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

Have more questions?

0 Comments

Please sign in to leave a comment.