Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins is very slow on first visit

Jenkins is very slow on the first visit in the early morning. This also happens if we restart the Jenkins server.

So the first developer accessing the jenkins has sometimes wait up to 3 minutes. We thought it was an issue with the build load. So we moved all build-jobs to a jenkins slave. But the issue has not been solved with it.

Since the performance seems to be always bad after restart. I assume jenkins reads a lot of stuff into memory. How can we enforce jenkins to precache stuff? We can give jenkins a hughe amount of RAM if needed. Hopefully the cache will solve the speed issues.

like image 452
cilap Avatar asked Mar 25 '15 10:03

cilap


People also ask

Why is my Jenkins so slow?

Fortunately, the most common reasons your Jenkins instance is slow are easy to diagnose and correct: Non-performant plugins. Poorly tuned JVM arguments. Non-optimal garbage collection.

How reduce Jenkins memory usage?

One is to make sure you're rotating your build history or discarding your old builds. That helps reduce Jenkins' memory footprint, which improves performance. We recommend keeping 30 to 60 days of build history, but you should configure this on a per-job basis.

How long does it take Jenkins to restart?

Whenever restart Jenkins it takes roughly half an hour to start up. Running strace on the process it is reading all the build histories.


1 Answers

It would be difficult to definitively say what is causing your Jenkins instance to take so long to startup, though it is highly likely that one of your installed plugins is the offender.

For example:

  1. JENKINS-17837 - Downstream Build View Plugin
  2. JENKINS-24945 - Global Build Stats Plugin

Surely there are other plugins besides these two which have bugs/issues resulting in slow startup times as well. Some may have had issues and subsequent versions have addressed the performance issues.

Therefore, performing the following steps should at least reveal the culprit if not entirely fix the issue:

  1. Upgrade Jenkins to the latest, stable version
  2. Upgrade all plugins to their latest, stable versions
  3. Restart Jenkins
  4. If startup remains slow, remove your plugins one at a time (ensuring to save their respective configurations if necessary)

If upgrading to the latest versions does not improve your startup time, step 4 should reveal the culprit.

like image 59
lax1089 Avatar answered Sep 18 '22 19:09

lax1089