Recent Posts

iptables rule ordering: the match-first-stop trap

Spent half a day on a production issue where a service was reachable externally but health checks timed out internally. Turned out two rules in the FORWARD chain were in the wrong order. iptables matches top-down and stops at first hit — no second chances for the same packet.

Tracking down a goroutine leak with pprof

Memory crept up to 2 GB within three days of launch. Restarts bought time but weren't a fix. Enabled the pprof endpoint and watched goroutine count climb ~60 per minute. Root cause: an unclosed channel left receivers blocked forever.

Shrinking a Docker image from 1.2 GB to 180 MB

Three usual culprits: wrong base image, no layer caching strategy, build artifacts left behind. Multi-stage builds and an Alpine base got us most of the way there. Notes on what worked and what didn't.