Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to improve Jenkins server performance?

Our Jenkins server(linux machine) slows down over a period of time and it gets unresponsive. All the jobs take unexpectedly long time(even though they run on slaves which are different machines from server). One of things I have observed is increase in the number of open files. The number seems to be increasing as shown in the image below. Does anyone have a solution to keep check on this without restarting the server? Also, are there any configurations/tweaks that could improve the performance of the jenkins server?

enter image description hereenter image description here

like image 308
Shiva Kumar Avatar asked Feb 22 '13 11:02

Shiva Kumar


People also ask

Why Jenkins server is 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 much RAM do I need for Jenkins?

Minimum hardware requirements: 256 MB of RAM. 1 GB of drive space (although 10 GB is a recommended minimum if running Jenkins as a Docker container)

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.


2 Answers

We are using Jenkins for four years and we tried to keep it up-to-date (Jenkins + plug-ins). Like you we experimented some inconvenience, depending on new versions of Jenkins or plug-ins... So we decided to stop this "continuous" upgrade

Here are humble tips:

  1. Avoid technical debt. Update Jenkins as much as you can, but use only "Long Term Support" versions (latest is 2.138.2)
  2. Backup your entire jenkins_home before any upgrade!
  3. Restart Jenkins every night
  4. Add RAM to your server. Jenkins use file system a lot and this will improve caching
  5. Define JVM min/max memory parameters with the same value to avoid dynamic reallocation, for example: -Xms4G -Xmx4G
  6. Add slaves and execute jobs only on slaves
like image 183
Destroyica Avatar answered Oct 15 '22 00:10

Destroyica


In addition to above, you can also try:

  1. Discarding old builds
  2. Distribute the builds on multiple slaves, if possible.
like image 34
Sanjeev Kumar Avatar answered Oct 15 '22 01:10

Sanjeev Kumar