Skip to content
ENExplore Calculators

Docker Restart Policy Estimator

Estimate container restart counts and backoff delays under different restart policies.

About Docker Restart Policy Estimator

Docker's restart backoff doubles with each attempt: delay(n) = initialBackoff × 2^(n−1). Total backoff = initialBackoff × (2^restarts − 1). The on-failure:N policy caps restarts, preventing infinite crash loops from consuming resources.

Formula

Total Backoff

totalBackoff = initialBackoff × (2^restarts − 1)

initialBackoff
Initial delay in seconds
restarts
Number of restart attempts

Worked example

With the default values below, Docker Restart Policy Estimator returns Restart Count of 5. Change any input above and every figure here is recalculated in your browser.

Inputs used

Crash Frequencyaccepts 0.1–1,000 crashes/hour
3 crashes/hour
Max Retry Countaccepts 1–1,000 retries
5 retries
Initial Backoffaccepts 0.1–60 seconds
1 seconds
Observation Windowaccepts 1–720 hours
24 hours

Results

Restart Count
5
Total Backoff Delay
31.0 seconds
Max Single Restart Delay
16.0 seconds
Expected Crashes in Window
72.0

Step by step

  1. 1Expected crashes in window= 72.0
  2. 2Actual restarts (capped by policy)= 5
  3. 3Total backoff time (exponential)= 31.0s

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation or fees or charges into account.
  • Figures are rounded for display to 1 decimal place, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

What's the difference between 'always' and 'on-failure'?

'always' restarts regardless of exit code (even clean exits); 'on-failure:N' only restarts on non-zero exit codes, up to N times, preventing infinite loops from application bugs.

Does Docker cap the backoff delay?

Docker caps the backoff at a platform-specific maximum (typically around 2 minutes on recent versions), preventing extremely long delays after many restarts.

Docker Restart Policy Estimator – Calculate Restart Count