Error budget formula
An error budget is how much failure an SLO (service level objective, the target for how often a service must work) allows. For requests: error budget = total requests × (100% − SLO). For time: error budget = window × (100% − SLO). The SRE Workbook gives an example. With a 99.9% success ratio SLO, a service that receives 3 million requests over four weeks has a budget of 3,000 errors, and one outage with 1,500 errors costs 50% of it. In the calculator, 1,200 failures use 40% of that budget and leave 1,800.
Requests or time
A request budget moves with traffic. The same 99.9% allows 3,000 failures in 3 million requests and 6,000 in 6 million. Failures are whole, so the budget rounds down: 97% of 3,663,253 requests is 109,897.59 failures, and the Workbook's Table 2-4 lists 109,897 allowed failures. A budget under one failure rounds down to none, so at 99.9% the first failure among 500 requests is over budget.
A time budget does not move with traffic: 99.9% over 30 days always allows 43m 12s. Some SLOs count intervals, not requests. In Google Cloud's example, a 99% goal over a rolling 30 days (always the most recent 30 days) of one-minute intervals needs 42,768 good minutes out of 43,200, which leaves 432 bad minutes, or 7h 12m. Use the Downtime tab for a budget counted in time.
Pitfall: 43m 12s or 43m 50s
This calculator counts a window as whole days of 24 hours, so 99.9% is 43m 12s over 30 days and 40m 19s over four weeks. The uptime calculator gives 43m 12s for a 30-day month too, but by default it uses the average month of 30.44 days: 43m 50s. Neither is wrong. Use the period your SLO is written over.
Warn before it runs out
Once the budget is used up, the next failure misses the SLO. To be warned while some is left, set alerts on how fast it is being used, with the SLO burn rate calculator.
FAQ
What is an error budget?
The share of failure an SLO allows over its window: 100% minus the SLO. Google Cloud describes it as starting at 1 minus the SLO and declining as the service misses the SLO. A 99.9% SLO leaves a budget of 0.1% of requests, or 0.1% of the time.
How do you calculate an error budget?
Multiply the total by 100% minus the SLO: the total requests for a request budget, the window for a time budget. For requests, total requests × (100% − SLO), rounded down to whole failures: 99.9% of 3 million requests allows 3,000. For time, the window × (100% − SLO): 99.9% over 30 days is 30 × 24 × 60 × 60 × 0.001 = 2,592 seconds, or 43m 12s. To see how much is used, divide the failures or the downtime by the budget.
Should an error budget be based on requests or time?
Use the kind your SLO counts: requests or time. Google Cloud's request-based SLOs count good and bad requests, and its windows-based SLOs count good and bad intervals, such as minutes. The Requests tab gives a budget in failures, and the Downtime tab gives one in time.
Does the error budget change with traffic?
A request budget does. 99.9% allows 3,000 failures in 3 million requests and 6,000 in 6 million, while the failure rate it allows stays at 0.1%. A time budget does not: 99.9% over 30 days is 43m 12s whatever the traffic.
What happens when the error budget runs out?
That depends on the policy your team agrees on. The SRE Workbook's example policy says that if the service has exceeded its error budget for the preceding four-week window, the team halts all changes and releases until the service is back within its SLO. The exceptions are P0 issues (the top-priority ones) and security fixes. The Workbook's chapter on implementing SLOs lists other common responses: give top priority to reliability bugs, work only on reliability until the system is within its SLO, or freeze certain changes until there is enough budget again.
Why does another calculator show 43m 50s for 99.9%?
Calculators count different periods. 43m 50s is 99.9% of an average month of 30.44 days. 43m 12s is 99.9% of a 30-day window, and 40m 19s is 99.9% of four weeks. This calculator uses whole days, so it matches the uptime calculator when that is set to a 30-day month. Pick the period your SLO is written over.