How a Scraper Swarm OOM-Killed My VPS
November 24, 2026 · 5 min read
My VPS started dying around 2:30am, SSH itself stoped responding and I had to use my provider’s VirtFusion console to try and reboot it.
If you just want the receipts, I filed the finding as a comment on an existing upstream fosrl badger issue. This is the longer version with the dead ends included.
The setup
A small VPS (2 vCPU / 2GB RAM) running Pangolin to tunnel and reverse-proxy about thirty self-hosted services back to my home network.
Three containers: pangolin (control plane, Node.js + SQLite), gerbil (wireguard gateway), and traefik (the actual reverse proxy, with Pangolin’s badger plugin handling auth and a crowdsec bouncer plugin handling IP reputation).
The outage
The kernel’s OOM killer started firing around 00:19, by 07:39 it had killed traefik 21 times and eventually started starving sshd itself, which is why I couldn’t even get in to look. Hard reset via the host panel, box comes back, I go digging.
Four more OOM kills in the next 40 minutes, roughly one every 5-10 minutes. docker stats told me what went wrong immediately, traefik’s memory climbing at roughly 140MB per minute from a cold start, hitting 500MB within four minutes of a fresh restart.
CONTAINER CPU % MEM USAGE (4 minutes after restart)
traefik 160.67% 541MiB / 1.89GiB
The access log pointed straight at one resource, kiwix.sooox.cc, a Kiwix mirror I run for offline Wikipedia access. Nearly every recent request was going there.
| Metric | Value |
|---|---|
| Request rate | ~23 req/s, sustained |
| Unique source IPs (sample of 2000 requests) | thousands, each IP appeared ~2 times |
| Response status | 418 on 1984/2000 sampled requests |
| Overhead per request (middleware time, from Traefik’s access log) | 97-105 seconds |
| Estimated concurrent in-flight requests at steady state | ~2,000+ |
The overhead row is the one that matters. A 418 (Pangolin’s “go away” response for blocked requests) looks like the system working as intended, the problem is that returning that single HTTP status took 100 seconds per request. At 23 requests a second, each held open for that long, it doesn’t take much to end up with thousands of requests stuck open at once.
While digging through Pangolin’s SQLite database for something else I found requestAuditLog sitting at 17,347,550 rows, 5.1GB, on a deployment with only 5 sites and 33 resources. I’ve got 7 day retention on that table, so that’s roughly 17 million logged requests in a week, almost entirely scraper and crawler noise.
Finding the actual bug
Traefik’s plugins get unpacked to disk, source and all, so I just went and read what badger (Pangolin’s forward-auth plugin for Traefik) does on every request:
// github.com/fosrl/badger, main.go
resp, err := http.Post(verifyURL, "application/json", bytes.NewBuffer(jsonData))
That’s it, that’s the bug. Go’s bare http.Post has no timeout. Every request to a protected resource makes this call, synchronously, to Pangolin’s own /badger/verify-session endpoint, and if Pangolin is slow for any reason there’s nothing stopping the call from just waiting forever.
Compare that to the crowdsec bouncer plugin sitting right next to it in the same Traefik instance:
httpClient: &http.Client{
Transport: &http.Transport{MaxIdleConns: 10, IdleConnTimeout: 30 * time.Second},
Timeout: time.Duration(config.HTTPTimeoutSeconds) * time.Second,
},
An actual timeout, the thing badger is missing. I also checked that crowdsec’s plugin wasn’t the source of the delay, in stream mode it only checks an in-memory cache per request, no network call on the hot path.
So the chain of failure:
- Scraper swarm sends a flood of unique-IP requests to one resource.
- Each request triggers badger’s uncapped POST to Pangolin.
- Pangolin is single-threaded (Node’s event loop) and starts falling behind under the load.
- Slow Pangolin responses mean slow badger calls, and with no timeout they just queue up instead of failing fast.
- More requests arrive before old ones resolve, the queue (and the memory/goroutines each one holds) grows without bound.
- Eventually the OOM killer steps in, kills Traefik, and the whole thing restarts.
I disabled the Kiwix resource to stop the bleeding, instant relief, Traefik memory dropped back to ~230MB and stayed there.
Contained, not fixed
Disabling a resource in Pangolin removes the route from Traefik’s dynamic config entirely. A request to a domain with no matching router just gets a 404 straight from Traefik before it ever reaches badger or Pangolin.
No amount of volume against a disabled resource can trigger the collapse, since the expensive call never happens at all.
| Metric | Before (kiwix enabled) | After (kiwix disabled) |
|---|---|---|
| Response | 418, ~97-105s overhead each | 404, ~1ms overhead |
| Request rate against the dead route | ~23 req/s | 54-58 req/s and still climbing |
| Traefik CPU | 150-190% | 80.89% |
| Traefik memory | climbing toward 1GB+ | steady ~280MB |
| Load average (2 cores) | 15-30 | 1.4 |
System’s stable now, but the scraper swarm hasn’t stopped, it’s grown, and it’s probably still probing indiscriminately. It’s just hitting a dead route at the moment, which is free to reject. Every other enabled resource (Nextcloud, Jellyfin, Vaultwarden, …) sits behind the exact same unprotected badger-only chain kiwix did. If this swarm, or a new one, starts hammering any resource that’s actually enabled, the same thing happens again, just somewhere else. Disabling kiwix bought time, it didn’t close the hole.
Since then I’ve started actually dashboarding CrowdSec’s alerts instead of just letting it quietly ban stuff in the background, 4213 alerts in the last 8 days:
Where it stands
The timeout bug in badger was already reported, issue #39 covers it in detail, including a confirmed-but-not-yet-landed fix in an open PR.
Rather than file a duplicate I added the production numbers above as a comment on that issue, since the existing report was backed by code reading and a synthetic repro, not an actual incident.
Takeaways, for anyone running a similar stack:
- An unbounded, timeout-less HTTP call anywhere in a request’s hot path is a latent outage, it will find a way to matter eventually.
- A
403/418/any “go away” response is only cheap to serve if producing it is actually cheap. Mine wasn’t.
One resource disabled, zero new infrastructure, and the box has been quiet since.