Galle, LK--:--5/6 sites live

Site Reliability Engineering (SRE), SLI, SLO, SLA & Error Budgets

පිටුව 19: Google SRE විප්ලවය, විශ්වසනීයත්වයේ ගණිතය: SLI, SLO, SLA සහ Error Budgets

Google හි Ben Treynor Sloss, SLI (මනින දේ), SLO (ඉලක්කය), SLA (ගිවිසුම), Error Budget පිච්චෙන වේගය (Burn Rate Graph) සහ Feature Freeze.

20 Sept 20264 min readSelf Guide · Stage 12#SRE#SLO#SRE Labs

Lab 19 of 20 · SRE & Error Budgets · 5 hands-on activities · bilingual (English + සිංහල)

පිටුව 19: Google SRE විප්ලවය, විශ්වසනීයත්වයේ ගණිතය: SLI, SLO, SLA සහ Error Budgets

Google හි Ben Treynor Sloss, SLI (මනින දේ), SLO (ඉලක්කය), SLA (ගිවිසුම), Error Budget පිච්චෙන වේගය (Burn Rate Graph) සහ Feature Freeze.

💡 සරල සිංහලෙන්: SLI, SLO, SLA සහ Error Budget එක කියන්නේ මොකක්ද?

Pizza Delivery උදාහරණය:

  • SLI (ඇත්තටම මනින දේ): Pizza 100 න් කීයක් විනාඩි 30න් ඩිලිවරි කළාද? (උදා: 98ක් වෙලාවට ගියා නම් SLI = 98%).
  • SLO (අපේ අභ්‍යන්තර ඉලක්කය): "අපි 99% ක් Pizza වෙලාවට දෙන්න ඕන" කියලා Pizza කඩේ ඇතුළේ කට්ටිය දාගන්න ඉලක්කය.
  • SLA (පාරිභෝගිකයා එක්ක ගිවිසුම): "විනාඩි 30න් Pizza එක ආවේ නැත්තම් Pizza එක නොමිලේ දෙනවා!" කියලා පාරිභෝගිකයාට දෙන පොරොන්දුව. කඩේ පාඩු වෙන්නේ මේක කැඩුනොත් තමයි!
  • Error Budget (වැරදෙන්න තියෙන ඉඩ): 100%ක් කිසිම කෙනෙකුට පරිපූර්ණ වෙන්න බෑ. 99% ඉලක්කයක් නම්, 1% ක් අපිට වරදින්න පුළුවන් කාලය (Error Budget) විදියට තියෙනවා. මේක ඉවර වුණොත් අලුත් Features දැමීම නවත්වා සයිට් එකේ ලෙඩ හදන එක විතරක් කළ යුතුයි (Feature Freeze).

Architectural Foundation & Systems Diagram

Site Reliability Engineering was created at Google in 2003 by Ben Treynor Sloss: "SRE is what happens when you ask a software engineer to design an operations team."

  • 📊 SLI (Indicator) — What is measured. Ratio of good events to total valid events:
    SLI = (Good Requests / Total Requests) * 100%

  • 🎯 SLO (Objective) — Internal Engineering Target. The reliability goal agreed upon with product managers (e.g. 99.9% uptime over rolling 30 days).

  • 📜 SLA (Agreement) — Legal Contract with Customers. Carries financial penalties if breached. SLO must ALWAYS be stricter than SLA!

Step-by-step practical lab

Step 01: Calculate Real-Time SLI Availability Percentage

සිංහලෙන් — සැබෑ දත්ත අනුව SLI Availability ප්‍රතිශතය ගණනය කරමු.

Calculate the Service Level Indicator: (Good Requests / Total Requests) * 100%.

ExampleShell
python3 -c "good=999800; total=1000000; sli=(good/total)*100; print(f'SLI Availability: {sli:.3f}%')"
  • SLI formula : (Good Requests / Total Requests) * 100% = සැබෑ පද්ධති සාර්ථකත්ව අනුපාතය.

Expected output

Output
SLI Availability: 99.980%

SRE Tip: The SLI tells you where you are right now; the SLO tells you where you need to be; the SLA tells you what happens if you fail!

Step 02: Calculate 30-Day Error Budget Allowance

සිංහලෙන් — 99.9% Uptime එකකදී අපට හිමි Downtime විනාඩි ගණන ගණනය කරමු.

Calculate allowed monthly downtime for a 99.9% Service Level Objective (SLO).

ExampleShell
python3 -c "mins = 30*24*60; slo = 0.999; allowed = mins*(1-slo); print(f'Allowed Downtime: {allowed:.2f} minutes/month')"
  • -c : Python script එක කෙලින්ම CLI එකෙන් run කරයි.

Expected output

Output
Allowed Downtime: 43.20 minutes/month

SRE Tip: Three 9s (99.9%) allows 43 minutes of downtime per month; Four 9s (99.99%) allows only 4.3 minutes per month!

Step 03: Evaluate 14.4x Critical Burn Rate Alert Threshold

සිංහලෙන් — Error Budget එක විනාශ වන වේගය (Burn Rate) ගණනය කරමු.

Calculate the current 1-hour burn rate multiple given observed error rates.

ExampleShell
python3 -c "errors=48; requests=10000; err_rate=errors/requests; slo=0.001; burn=err_rate/slo; print(f'Burn Rate: {burn:.1f}x (Threshold: 14.4x)')"
  • burn rate : Burn rate = observed error rate / allowed error rate.

Expected output

Output
Burn Rate: 4.8x (Threshold: 14.4x)

SRE Tip: If burn rate exceeds 14.4x, 2% of your monthly error budget is consumed in 1 hour; an emergency page must trigger immediately!

Hands-on practice activities

Work through these yourself — tick them off as you go.

  • Activity 91: Calculate SLI Availability Percentage (Checkpoint) — If 999,000 requests succeeded out of 1,000,000, calculate: SLI = (999,000 / 1,000,000) * 100% = 99.9%.
  • Activity 92: Calculate 30-Day Three Nines (99.9%) Downtime (Checkpoint) — Understand that 99.9% availability permits exactly ~43.2 minutes of total allowable downtime per month.
  • Activity 93: Evaluate 14.4x Burn Rate Alert (Checkpoint) — A 14.4x burn rate burns 100% of your 30-day error budget in just 48 hours (2 days), requiring an immediate SEV-1 page!
  • Activity 94: Enforce Release Freeze Rule (Checkpoint) — When the error budget is exhausted (0% remaining), freeze all new feature deployments and focus 100% on reliability!
  • Activity 95: SRE Origins Quiz (Quiz) — Who founded Site Reliability Engineering at Google in 2003? Answer: Ben Treynor Sloss.

Keep going: ← Lab 18 · Lab 20 → · Track your progress in the Self Guide

ExerciseKnowledge check

If a service commits to a 99.9% SLO over 30 days (43,200 mins), what is the allowed monthly downtime? / 99.9% SLO එකකදී හිමි downtime කාලය කොපමණද?

Finished this one?

Part of Self Guide · Stage 12: SRE Labs III — SLOs, error budgets and observability. Progress is saved in this browser.

Guide