KatInterview

On-Call Playbook: Memory Alarm in a Card-Funding Service

System DesignModel answer
MediumModel answerSystem Designincident-responseobservabilitydebugging

Last updated

Walk through how you would triage, diagnose, mitigate, and follow up on a memory alert in a service that funds couriers' payment cards via a third-party provider and a Redis cache.

Scenario

You are the on-call engineer for a food and goods delivery platform.

How the system fits together

  • Couriers use a mobile app to pick up and complete deliveries.
  • The app talks to a public-facing gateway, the Courier Gateway.
  • The gateway calls an internal Card Funding Service.
  • For certain merchants, couriers must pay at the counter with a prepaid debit card. The card is loaded with money programmatically at checkout through an external card-issuing provider.
  • The funding service keeps card and account data in a Redis cache.
  • The company is partway through moving from a monolith to microservices.
Courier App -> Courier Gateway -> Card Funding Service -> External Card Provider
                                   Card Funding Service <-> Redis

The page

It is 4:30 PM Pacific, right as the dinner rush is ramping up. You receive an alert: the Card Funding Service has memory utilization well above its normal level.

What to deliver

Describe how you would run this investigation from the first page to the post-incident review. Cover each of the following:

  1. How you would judge severity and business impact.
  2. Which metrics, dashboards, and logs you would look at first.
  3. The most probable causes of high memory in this particular architecture.
  4. How you would tell apart traffic growth, a recent deploy, Redis problems, retry amplification, and a slow or failing provider.
  5. Immediate mitigations you would consider, and their risks.
  6. How you would communicate while the incident is in progress.
  7. Longer-term fixes and follow-up work after recovery.

Hints

Hint 1

High memory is a symptom. Before digging into causes, decide whether couriers and orders are actually being hurt, and how much time you have before pods get OOM-killed.

Hint 2

Look at the shape of the memory curve: a step change at a deploy time, a sawtooth with a rising floor (leak), growth proportional to request rate, or growth that begins right after provider latency rises each point to a different cause.

Hint 3

Compare inbound request rate to outbound provider calls, check Redis hit ratio and latency, and compare pods against each other. Capture a heap dump from one pod before restarting anything. Note that scaling out can worsen a slow-provider problem.