connpool: A Zero-Alloc TCP Connection Pool for Go
The Story Years ago, when I first needed TCP connection pooling in Go, I found fatih/pool. It was elegant, simple, and it taught me a lot about channel-based pooling design. It was a real inspirati...

Source: DEV Community
The Story Years ago, when I first needed TCP connection pooling in Go, I found fatih/pool. It was elegant, simple, and it taught me a lot about channel-based pooling design. It was a real inspiration. But as I worked on high-throughput systems at scale, I kept running into gaps: no health checks, no idle eviction, no lifetime management, no metrics. I'd bolt these on as wrappers, and eventually realized I was maintaining a full pool implementation anyway. So I built connpool — taking the channel-based foundation that fatih/pool popularized and adding the features that production systems actually need. Introducing connpool github.com/soyvural/connpool — a production-grade TCP connection pool for Go. go get github.com/soyvural/[email protected] Zero dependencies. ~370 lines of code. Zero-alloc fast path. Quick Example cfg := connpool.Config{ MinSize: 5, MaxSize: 20, Increment: 2, IdleTimeout: 30 * time.Second, MaxLifetime: 5 * time.Minute, Ping: func(c net.Conn) error { c.SetReadDeadline(t