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
-
CloudBees CI (CloudBees Core) on traditional platforms - Client controller < 2.7.3
-
CloudBees Jenkins Enterprise - Managed controller < 2.7.3
-
Jenkins LTS < 2.7.3
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.
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.