AlgoViz

Load balancer monitoring

medium 30 min

Every 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

Our systemUsers0 a secondLoad balancer0 openBackend 1healthyBackend 2healthyBackend 3healthy

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 rateWindowsBudget usedAction
fast14.41 h and 5 min2%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

    critical

    Every user and order makes a new series until the store runs out of memory.

    Wrong
    requests.inc(path=request.path)
    Right
    requests.inc(route="/users/:id")
  • Averaging percentiles

    major

    The result is the percentile of nothing.

    Wrong
    avg(p99_per_server)
    Right
    histogram_quantile(0.99,  sum by (le) (rate(duration_bucket[5m])))
  • A deep check for the balancer

    critical

    One slow database removes all servers.

    Wrong
    GET /health -> checks database, cache
    Right
    GET /health -> this process onlyGET /health/details -> for people
  • Paging on causes

    minor

    A busy processor hurts nobody by itself. People learn to ignore the pager.

    Wrong
    if cpu > 80: page()
    Right
    if 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.