Advanced Jenkins
Backup and Configuration Management
Pipeline Durability
Learn how to configure and optimize Jenkins Pipeline Durability to balance performance, disk I/O, and recoverability. This guide covers durability levels, configuration scopes, and a hands-on demonstration.
What Is Pipeline Durability?
Pipeline durability determines how frequently Jenkins writes the pipeline state to disk. Frequent writes ensure resumability after crashes but can introduce latency. Jenkins offers three levels:
Durability Level | Description | Resume After Crash |
---|---|---|
MAX_SURVIVABILITY | Always writes state to disk; slowest but fully recoverable. | Yes |
SURVIVABLE_NON_ATOMIC | Reduces atomicity guarantees for fewer disk writes; recoverable. | Yes |
PERFORMANCE_OPTIMIZED | Minimizes disk I/O for maximum speed; not recoverable. | No |
Warning
Choosing PERFORMANCE_OPTIMIZED
can improve throughput but pipeline progress is lost if Jenkins shuts down uncleanly.
Where to Configure Durability
You can apply durability settings at three levels:
- Global – Default for all jobs.
- Multibranch project – Per-branch overrides.
- Single pipeline job – Specific to one Declarative Pipeline.
1. Global Configuration
- Go to Manage Jenkins → Configure System.
- Search for Pipeline Speed and Durability.
- Select your default level.
In newer Jenkins releases, you may also see a dedicated dropdown:
2. Multibranch Project Configuration
For GitHub Organization or Multibranch Pipelines, set durability per branch:
- Open your project and click Configure.
- Under Branch Sources, expand Property strategy.
- Add Pipeline durability and define rules.
Example:
main
→ MAX_SURVIVABILITY- All other branches → PERFORMANCE_OPTIMIZED
3. Single Pipeline Job Configuration
In any Declarative Pipeline job:
- Scroll to Pipeline Speed and Durability.
- Choose the desired level:
Demonstration: Durability in Action
Create a simple pipeline that appends numbers every second. Kill Jenkins mid-run to observe each durability mode.
Pipeline Definition
pipeline {
agent any
stages {
stage('For Loop - Durability Test') {
steps {
script {
sh 'touch numbers.txt'
for (int i = 0; i < 600; i++) {
sh "echo ${i} >> numbers.txt"
sleep 1
}
}
}
}
}
}
MAX_SURVIVABILITY Test
Set Pipeline Speed and Durability to Maximum survivability.
Start the build and note the output.
Identify and kill the Jenkins process:
ps aux | grep -i jenkins.war kill -9 <PID> systemctl status jenkins
After restart, open the build console. The pipeline resumes at the last completed step:
[Pipeline] sleep Sleeping for 1 sec [Pipeline] sh + echo 41
PERFORMANCE_OPTIMIZED Test
Switch durability to Performance optimized and rebuild.
Kill Jenkins mid-run as before.
After restart, the build fails with:
ERROR: Cannot resume build because FlowNode 42 for FlowHead 1 could not be loaded. This is expected when using PERFORMANCE_OPTIMIZED and an unclean shutdown occurred. Finished: FAILURE
Note
The Jenkins dashboard will show the failed run under your project’s history.
Conclusion
- Use MAX_SURVIVABILITY for mission-critical or production pipelines requiring resumability.
- Use PERFORMANCE_OPTIMIZED when throughput is the priority and occasional rebuilds are acceptable.
- Adjust the scope—global, per-branch, or per-job—to match your workflow.
Links and References
Watch Video
Watch video content
Practice Lab
Practice lab