Controller and JENKINS_HOME

The Controller Process and JENKINS_HOME

The controller is one Java process running jenkins.war with an embedded Jetty 374,433 web server; in the official image it is PID 7, started by tini 11,240 . On this machine it held 785 MiB of memory with 92 plugins and almost no jobs. Everything durable lives in JENKINS_HOME (/var/jenkins_home in the image), and it is all plain files: Jenkins 8,793 has no database. Objects are serialized to XML by the XStream library, which is why element names such as hudson.model.Cause_-UserIdCause look like Java class names.

What fills JENKINS_HOME on a new controllerShell
docker exec l2-jenkins sh -c 'cd /var/jenkins_home && du -sh war plugins jobs'
Output
111M   war
187M   plugins
356K   jobs
The layout of JENKINS_HOME
Path in JENKINS_HOME Contents
config.xml, *.xml Global settings, one file per plugin or subsystem
jobs/NAME/config.xml, builds/N/ A job's definition; one build's build.xml, log and state
nodes/NAME/config.xml A permanent agent's definition
plugins/, war/ Installed .jpi files and the unpacked web application
secrets/ master.key and the keys that encrypt stored credentials

A backup is therefore a consistent copy of the directory (Backing Up JENKINS_HOME). Never hand-edit the XML while the controller runs, since the in-memory model overwrites it on the next save, and give JENKINS_HOME a fast disk.