Uptime
Uptime
The time a system operates normally. Guaranteed by SLA. 99.99% = 52 minutes of downtime per year.
Uptime
The time a system operates normally. Guaranteed by SLA. 99.99% = 52 minutes of downtime per year.
Uptime is the percentage of time that a system operates normally and provides service. It is usually expressed as a percentage and is a key metric of an SLA (Service Level Agreement). 99.9% ("three nines") is a common target, and 99.99% ("four nines") is the standard for high availability.
The allowed downtime for each Uptime percentage is as follows: 99% (two nines) allows 3.65 days per year, 99.9% (three nines) allows 8.76 hours per year, 99.99% (four nines) allows 52.6 minutes per year, and 99.999% (five nines) allows 5.26 minutes per year. A difference of one digit actually means a 10-fold difference in stability.
Strategies for increasing Uptime include redundancy, load balancing, automatic failover, canary deployment, and circuit breakers. Planned maintenance is also counted as downtime, so zero-downtime deployment and rolling updates are important.
In practice, Uptime is measured continuously with monitoring tools such as Uptime Robot, Pingdom, and Datadog. A status page is operated to disclose real-time availability to customers, and when an outage occurs, a post-mortem is conducted to prevent recurrence. An Error Budget is the budget of downtime available relative to the SLO.
# Prometheus + Grafanaλ‘ Uptime λͺ¨λν°λ§
# prometheus-rules.yaml - SLO/SLI μ μ
groups:
- name: slo-rules
rules:
# μ±κ³΅ μμ² λΉμ¨ (SLI)
- record: http_request_success_rate:5m
expr: |
sum(rate(http_requests_total{status!~"5.."}[5m]))
/
sum(rate(http_requests_total[5m]))
# 99.9% SLO μλ° μ¬λΆ
- alert: HighErrorRate
expr: http_request_success_rate:5m < 0.999
for: 5m
labels:
severity: critical
annotations:
summary: "μλΉμ€ κ°μ©μ± SLO μλ°"
description: "νμ¬ μ±κ³΅λ₯ : {{ $value | humanizePercentage }}"
# Error Budget μμ§μ¨
- record: error_budget_remaining:30d
expr: |
1 - (
(1 - avg_over_time(http_request_success_rate:5m[30d]))
/
(1 - 0.999) # 99.9% SLO
)
---
# Kubernetes Liveness/Readiness Probe μ€μ
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-server
spec:
replicas: 3 # κ³ κ°μ©μ±μ μν 볡μ λ³Έ
template:
spec:
containers:
- name: api
image: myapp/api:v1.0.0
ports:
- containerPort: 8080
# Liveness: 컨ν
μ΄λκ° μ΄μμλμ§ νμΈ
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 3
# Readiness: νΈλν½μ λ°μ μ€λΉκ° λμλμ§ νμΈ
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 2
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
---
# PodDisruptionBudget - μ
κ·Έλ μ΄λ μ€ κ°μ©μ± 보μ₯
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: api-pdb
spec:
minAvailable: 2 # μ΅μ 2κ° Pod μ μ§
selector:
matchLabels:
app: api-server
---
# μν νμ΄μ§ API μμ (Node.js)
# GET /status μλ΅ μμ
{
"status": "operational",
"uptime": "99.98%",
"uptime_30d": "99.95%",
"components": {
"api": { "status": "operational", "latency_p99": "45ms" },
"database": { "status": "operational", "latency_p99": "12ms" },
"cache": { "status": "degraded", "message": "Redis failover in progress" }
},
"incidents": [
{
"id": "inc-2024-001",
"title": "API μλ΅ μ§μ°",
"status": "resolved",
"duration_minutes": 15,
"resolved_at": "2024-01-15T10:30:00Z"
}
]
}
Senior: "We've almost used up this month's error budget. The SLO is 99.9%, and we've already been down for nearly 8 hours."
Junior: "Then should we hold off on deploying new features this month?"
Senior: "Yes, let's focus on stability work and push risky changes to next month. Once the error budget recovers, we'll pick the pace back up."
Interviewer: "What architecture would you design to achieve 99.99% availability?"
Candidate: "I would eliminate single points of failure with a Multi-AZ deployment and respond to load with autoscaling. For the database, I would configure read replicas and automatic failover, and at the application level, I would implement circuit breakers and retry logic. For zero-downtime deployment, I would use blue-green or canary deployment."
Take a mock interview on this topic β WIA SOOM AI Interview Β· Start for free
Reviewer: "There's no readinessProbe. If the pod receives traffic even when the DB connection is down, errors will flood in."
Developer: "I'll add a check of the DB and Redis connection status at the /ready endpoint. I'll also set failureThreshold appropriately."