Unbounded cache debugging lab. Memory climbs in a straight line until the kernel kills the thumbnail service. Then it starts again.
Practice debugging a unbounded cache in a live, broken production system in your browser, with HTTP. Find the root cause in the logs, terminal and code, fix it, and a load test checks that the fix holds under real traffic.
1. The Incident Context
The thumbnail service restarts on its own about every 40 minutes. Each restart drops the requests in flight, and the storefront's image grid shows broken tiles for a few seconds. Nothing was deployed this week. Last Friday the catalog grew from 2,000 to 200,000 images.
2. Observed Symptoms & Metrics
- Affected Endpoints / Components:
GET /thumb/{imageId}?w={width} on the thumbnail service. It fetches full-size photos from the image origin at localhost:9300.
- Behavior: Requests are fast. The app's memory (RSS) climbs in a straight line and never goes down, even when traffic pauses. At the 512 MB limit the process is killed and starts again.
- Error Rate: Near zero between crashes. Each crash fails every request in flight and the next few seconds of traffic.
- System Metrics: The App logs show
Memory cgroup out of memory: Killed process. CPU is low between crashes. The origin is healthy.
3. Application Logs
2026/10/12 06:00:00 thumbnail service listening on :8080
2026/10/12 06:20:00 cache_entries=10288
2026/10/12 06:39:00 cache_entries=19977
Memory cgroup out of memory: Killed process 1 (thumbs) anon-rss:524288kB, limit 512MB
2026/10/12 06:39:04 thumbnail service listening on :8080
# ps -o rss,cmd -u lab (RSS in KB)
RSS CMD
489012 /tmp/app
4. Your Objective
Step into the live environment while synthetic traffic is running, find the root cause, and patch the code.
To clear this stack, your fix must pass these checks under a 150-second load test at 120 req/s. Traffic is spread over all 200,000 images and 4 widths, and sped up so the old code runs out of memory within the test:
- Stability: The app is never OOM-killed (
app_oom_kills == 0), and its RSS stays under 300 MB (app_rss_mb_max <= 300).
- Performance: After a 10-second warm-up, P99 thumbnail latency stays below 150 ms (
thumb_ms_p99 < 150).
- Error Rate: Fewer than 1% of requests fail (
http_errors < 1%).
- Data Integrity: Every response is a valid JPEG of the requested width (
failed_checks <= 0).
Toolbox: curl -o /dev/null -w '%{time_total}s %{size_download} bytes\n' 'localhost:8080/thumb/42?w=256', curl localhost:9300/stats, ps -o rss,cmd -u lab, htop. Save a file in the editor to rebuild and restart the app. Click Verify when you think it's fixed.
Terms in this lab: RSS, OOM, p99, req/s, origin (the storage that holds the full-size photos).
You can browse stacks without an account. To run labs you sign in with your email or Google account. BustedStack uses your email address to
sign you in, and your name and profile picture to show your account and pre-fill certificates. We never access your Gmail, contacts or Drive,
sell your data or run ad trackers.
This site needs JavaScript to run labs.