All Stories

Writing a High-Throughput Custom DNS Resolver in Go

A crawler or an ingress resolving thousands of distinct hostnames per second exposes a gap in the standard library. The folklore is that net.LookupHost blocks OS threads via cgo —...

Profiling Go Memory and CPU Bottlenecks with `go tool pprof` and `trace`

Guessing where CPU goes is how services die slowly. Go ships a world-class profiler; the real skill is using it correctly, because each profile type answers a different question and...

Designing a High-Throughput Worker Pool in Go for API Ingestion

Goroutines are cheap — a couple of KiB of stack, sub-microsecond spawn — so teams over-rotated from “thread per request” to “goroutine per request” and hit a wall. Unbounded concurrency...

Hardening Rails Security: Implementing Strict Content Security Policy (CSP) and SRI Headers

Browser XSS filters were always a poor backstop, and they’re not even that anymore. The real defense is telling the browser exactly what it’s allowed to execute, and Content Security...

High-Performance I/O in Go: Custom io.Reader and io.Writer Optimizations

A read syscall costs a few hundred nanoseconds to a few microseconds depending on kernel and storage. That sounds cheap until you multiply by bytes. A 1 GiB log file...

Implementing Graceful Shutdown in Distributed Go Microservices

Kubernetes terminates pods the same way every time: it sends SIGTERM, waits terminationGracePeriodSeconds (30 by default), then sends SIGKILL. If your service treats SIGTERM as “start dying right now”, every...