Load balancer monitoring
medium 30 minEvery request passes the load balancer, so it is the best place to see how the whole system feels from outside.
See it run
A dashboard that tells the truth, errors with an owner, percentiles that add up, checks that do not cause outages, and alerts worth waking for.
Operations
The dashboard
Requests a second, P50, P99, errors, open connections, healthy backends and alerts, through one incident.
Step 1 of 6
Start
P50 / P99
- · -
errors
-
alert
none
No data is not good data
Nothing measured yet. A chart without data is not a green chart.
Step 1: Start
if error_rate > 2.5: alert("critical")elif p99 > 200: alert("warning")if healthy < total: alert("warning")- Answers
- Is it wrong?
- Costs
- Few series
- Alert limits here
- errors 2.5%, P99 200 ms
The limits here are small on purpose so that the steps show them. Use limits from your own promise.
In the real world
The same load balancer monitoring doing real jobs. Pick one and step through it.
A promise of 99.9% leaves a budget of 0.1% for 30 days.
Step 1 of 3
Fast
| Burn rate | Windows | Budget used | Action | |
|---|---|---|---|---|
| fast | 14.4 | 1 h and 5 min | 2% | page |
| medium | ||||
| slow |
Wake somebody
1.44% of requests fail. That is 14.4 times the allowed rate: 2% of the month's budget in one hour. Page.
Step 1: Fast
Common mistakes
The bugs interviewers watch for, with the fix beside each.
Raw paths as a label
criticalEvery user and order makes a new series until the store runs out of memory.
Wrongrequests.inc(path=request.path)Rightrequests.inc(route="/users/:id")Averaging percentiles
majorThe result is the percentile of nothing.
Wrongavg(p99_per_server)Righthistogram_quantile(0.99, sum by (le) (rate(duration_bucket[5m])))A deep check for the balancer
criticalOne slow database removes all servers.
WrongGET /health -> checks database, cacheRightGET /health -> this process onlyGET /health/details -> for peoplePaging on causes
minorA busy processor hurts nobody by itself. People learn to ignore the pager.
Wrongif cpu > 80: page()Rightif burn(1h) >= 14.4 and burn(5m) >= 14.4: page()
Interview tips
How to explain it
- Rate, errors, duration at the balancer.
- Its own errors and the servers' apart.
- Metrics say that, traces where, logs what.
Memory tricks
- RED for requests.
- USE for resources.
- Flag, logbook, one swimmer's way.
Alert on
- What users feel.
- Burn rate in two windows.
- Missing traffic and outside probes.
Keep it affordable
- Route patterns as labels.
- Sample normal logs, keep errors.
- Tail sampling for traces.