Skip to content

Instantly share code, notes, and snippets.

@dontstopbelieveing
Last active December 22, 2025 20:21
Show Gist options
  • Select an option

  • Save dontstopbelieveing/1912effe022dc9883d71dea91f0c2f0c to your computer and use it in GitHub Desktop.

Select an option

Save dontstopbelieveing/1912effe022dc9883d71dea91f0c2f0c to your computer and use it in GitHub Desktop.
Google SRE book notes

As we increase reliability cost increases so risk of unavailability has to be balanced with goal of innovation and efficient servbice operations

Cost has 2 aspects

  • cost of redundant compute
  • opportunity cost

Service should be reliable enough but no more reliable than we need to make it.

Measuring service risk

How to determing service availability

  • Measure acceptable level of unplanned downtime

availability = uptime / (uptime + downtime)

Availability Downtime allowance
5 9s 5.26 mins
4 9s 52.6 mins
99.95% 4.38 hours
3 9s 8.76 hours

In a distributed system time based availability is not very meaningful because given fault tolerance we will be partially available at all times. A better metric is request success rate

availability = successful requests / total requests

In a typical application not all requests are equal - a new sign up failing is different from failing for polling new email in background

Set quarterly availability targets for a service and track our performance against those targets on a weekly basis.

Identifying risk tolerance of consumer services

  • work with product owners to turn business goals into explicit objectives
  • In absence of a product team the following questions can help assess the risk tolerance of a services
    • what level of availabiltiy is required
    • do different types of failures have different effects on a service?
    • how can we use the service cost to help locate a service on the risk continuum
    • what other service metrics are important to take into account?

Target level of availaibility

  • what level of service will the users accept?
  • does this service directly tie to revenuw?
  • Is this paid service or is it free?
  • if there are competitors in the market what level of service do those provide?
  • is this service targeted at busineses or consumers?

Type of failures

  • how resilient is our business to service downtime?
  • Which is worse for service - cosntant low rate of failures or an occasional full site outage?

Cost

  • If we were to build and operate this system at one more nine of availability what would our incremental increase in revenue be?
  • Does this additional revenue offset the cost of reaching that level of reliability?

Additional takeaways

  • a shared piece of infra may serve 2 use cases one needs high latency other more throughput, one of the ways to achieve that is to partition the infra according to se case and offer it at multiple levels of service for ex low latency cluster vs high throughput cluster
  • splitting levels of service in this way offers clients the choice to select level of service that fits in with thier cost

Risk / effort boundary

Ask the following questions to determine a risk / effort boundary

  • Software fault tolernace
  • Testing
  • Push Frequency
  • Canary duration and size

How is an error budget determined?

  • Product management defines a SLO for quarter
  • actual uptime is measured by a third party - eg monitoring
  • difference between 2 is the how much error budget is remaining
  • as long as it is remaining - new changes can be pushed.

SLI - Service Level Indicator

An SLI is a service level indicator—a carefully defined quantitative measure of some aspect of the level of service that is provided.

eg latency, error rate, throughput, availability (also called yield), durability (for data systems) - often aggregated to median, average or max

SLO - Service level Objective

An SLO is a service level objective: a target value or range of values for a service level that is measured by an SLI. A natural structure for SLOs is thus SLI ≤ target, or lower bound ≤ SLI ≤ upper bound.

SLA - Service level Agreement

Finally, SLAs are service level agreements: an explicit or implicit contract with your users that includes consequences of meeting (or missing) the SLOs they contain. Ask what happens when a SLO is not met

Choosing metrics for SLIs

What do you and your users care most about? user facing systems: throughput, latency and availability storage systems: latency, availability and durability big data systems: throughput and end to end latency

Getting indicators

  • Collection
  • Aggregation - averages, distributions
  • Standardize indicators so that we don't have to reason on them from first principles every time - averaged over 1 minute, all in a region, every 10 seconds etc.

Choosing targets

  • dont choose a target based on current performance
  • keep it simple
  • avoid absolutes
  • have few slos
  • keep a safety margin
  • dont overachieve

What is Toil?

Toil is work that is

  • manual
  • repetitive
  • automatable
  • tactical
  • no enduring value
  • O(n) with service growth

Calculating Toil

  • 25% in 4 weeks is toil in a 4 person rotation.

Different types of work that SRE does

  • software engineering
  • systems engineering
  • Toil
  • Overhead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment