Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve jenkins 'Disk space is too low' issue?

I have deployed Jenkins in my CentOS machine, Jenkins was working well for 3 days, but yesterday there was a Disk space is too low. Only 1.019GB left. problem.

How can I solve this problem, it make my master offline for hours?

like image 695
Eason Avatar asked Apr 26 '12 01:04

Eason


People also ask

How do I check my Jenkins disk space?

You can see project list with occupied disk space by going to the "Disk Usage" page in the management section (Dashboard -> "Manage Jenkins" -> "Disk Usage"). The same page also allows you to schedule disk usage calculation immediately.

How much space does Jenkins need?

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


1 Answers

You can easily change the threshold from jenkins UI (my version is 1.651.3):

[jenkins nodes preventing monitoring page]


Update: How to ensure high disk space

This feature is meant to prevent working on slaves with low free disk space. Lowering the threshold would not solve the fact that some jobs do not properly cleanup after they finish.

Depending on what you're building:

  1. Make sure you understand what is the disk output of your build - if possible - restrict the output to happen only to the job workspace. Use workspace cleanup plugin to cleanup the workspace as post build step.
  2. If the process must write some data to external folders - clean them up manually on post build steps.

Alternative1 - provision a new slave per job (use spot slaves - there are many plugins that integrate with different cloud provider to provision on the fly machines on demand)

Alternative2 - run the build inside a container. Everything will be discarded once the build is finished

like image 136
orshachar Avatar answered Sep 22 '22 20:09

orshachar