Skip to content

SLIs, SLOs and SLAs

From “slow” and “broken” to a number

Section titled “From “slow” and “broken” to a number”

Dashboards show many numbers, and none of them says whether users are happy. “p95 is 184 ms” is neither good nor bad until someone has decided what the service should do. Three terms from the SRE book make that decision explicit, and they are easy to confuse. The availability lesson introduced them. This lesson uses them for real arithmetic.

  • An SLI, a service level indicator, is a carefully defined quantitative measure of some aspect of the level of service that users get.
  • An SLO, a service level objective, is a target value or range of values for a service level that an SLI measures.
  • An SLA, a service level agreement, is a contract with users that includes consequences for meeting or missing the SLOs it contains.

The easiest way to tell an SLO from an SLA, the SRE book says, is to ask what happens if the target is missed. If there is no explicit consequence, such as a refund or a penalty, you are almost certainly looking at an SLO.

Mental model. The SLI is the thermometer, the SLO is the temperature you promise yourself, and the SLA is the clause in the contract that costs money if you miss it. Teams work to the SLO; the SLA is what they hope never to trigger.

The Workbook gives one shape for nearly every SLI: the number of good events divided by the number of valid events. It is a percentage between 0% and 100%, where 0% means nothing works and 100% means nothing is broken. Two events are enough to cover most services.

  • Availability. Good events are requests that succeed, and valid events are requests that were well formed. For the shop, successful requests / valid requests.
  • Latency. Good events are requests that finished faster than a threshold. For the shop, requests answered in under 150 ms / valid requests. This is the same as “the 95th percentile is under 150 ms” when the target is 95%, and it is a proportion, which is why it can be summed over time and over servers where a percentile cannot.

The SRE book’s observation about user-facing serving systems is that they generally care about availability, latency and throughput. The Workbook lists other kinds of SLI, such as quality, freshness, correctness and durability, for services where they matter more.

An SLI is meant to measure what users experience, so it is better measured near them. A service’s own counter cannot count the requests that never reached it, and a count taken at the load balancer can.

An SLO says how high the SLI must be, and over how long. “99.9% of valid requests succeed, over a rolling 30 days.” The window matters because the SLI changes from minute to minute, and a target that is judged on a single minute would say nothing about a bad hour.

The target decides how much failure is allowed. The shop receives 300 requests a second, which is 300 × 86,400 × 30, or 777,600,000 requests in 30 days. An SLO of 99.9% allows 0.1% of them to fail:

777,600,000 × 0.001 = 777,600 failed requests in 30 days.

The same allowance can be written as time. If every request failed, 30 days hold 30 × 24 × 60, which is 43,200 minutes, and 0.1% of that is 43.2 minutes of complete outage. The two are the same budget in two units, as long as traffic is steady. Each tenth of the target moves it by the same factor:

SLO over 30 days Failure allowed Failed requests at 300 a second Complete outage
99% 1% 7,776,000 7.2 h
99.5% 0.5% 3,888,000 3.6 h
99.9% 0.1% 777,600 43.2 min
99.95% 0.05% 388,800 21.6 min
99.99% 0.01% 77,760 4.32 min

Going from 99.9% to 99.99% cuts the allowance by ten, from 43.2 minutes to 4.32. At that last row a single ten-minute failed deploy spends more than twice the whole month’s allowance.

An SLA is written for a customer and has consequences, usually financial. The SRE book gives a reason why the numbers differ: a tighter internal SLO than the one advertised to users leaves room to respond to chronic problems before they become visible outside. If the contract promises 99.5%, a team that holds itself to 99.9% has a margin between its own alarm and the customer’s refund.

No target is the obvious one, and 100% looks like the right one. The Workbook advises against it: a 100% target prevents the service from being improved and creates operational demands that cannot be sustained. A target has to leave room for something to go wrong, and that room is the error budget of the next lesson.

The other trap is to take today’s number. The SRE book warns against picking a target based on current performance, and against over-delivering: if the service is much better than its target, users come to rely on that performance, and a later drop back to the target feels like a failure. The target should come from what users need, and from what the team can sustain.

Check your understanding: SLIs, SLOs and SLAs

This quiz needs JavaScript to check your answers.

Question 1 of 3

An online shop writes down three statements about its checkout.

Which one is an SLO?

Choose one answer.

Question 2 of 3

A service has an SLO of 99.95% of requests succeeding over 30 days. Traffic is steady.

How long a complete outage does the SLO allow over the 30 days?

Enter a number and choose its unit.

Question 3 of 3

A service has met 99.99% over the last year. The team sets its SLO at 99.99% 'because that is what we do'.

What is the problem with that choice?

Choose one answer.

  • An SLI is good events over valid events. An SLO is a target for the SLI over a window. An SLA is a contract with consequences if its objectives are missed.
  • 99.9% over 30 days at 300 requests a second allows 777,600 failed requests out of 777,600,000, or 43.2 minutes of complete outage.
  • 99% allows 7.2 hours, 99.5% allows 3.6 hours, 99.95% allows 21.6 minutes and 99.99% allows 4.32 minutes.
  • A latency SLI counts a slow request as bad. An availability SLI does not.
  • A target of 100% forbids change, and a target copied from current performance becomes a promise nobody chose.
  • Keeping the internal SLO tighter than the SLA leaves room to react before the customer is affected.

Next: error budgets and burn rates, which say how fast the allowance is being spent.

Your progress

Built by GhaziAlibi.

© ShardCraft. All rights reserved.