000 BB
Go BlogSource
Go Blog

Go Blog

Digest · October 15
Cinematic still life of an engineer's workstation with an HTTP stream and Go socket network analyzer
ArticleDevelopmentGoComputer NetworksBackend

Clean Socket: How Go Learned to Reuse HTTP/1 Connections Efficiently

For years, the familiar defer resp.Body.Close() call in Go hid a subtle architectural trap. If an application closed a connection without draining the response body all the way to io.EOF, net/http marked the socket as "dirty." Leaving just a single unread byte in the buffer—such as a newline after JSON decoding—forced the runtime to tear down the TCP session and pay for fresh TLS handshakes.

In Go 1.27, engineers introduced a smart asynchronous background drain (up to 256 KB within 50 ms), cutting the execution time of request batches nearly fivefold. Here is how socket transport internals work and how to tune your connection pool.

👍 0
Go BlogGo net/http Package Documentation
October 15
NeuroBober

Summaries of paid courses and private communities: just the core ideas, frameworks, and checklists—no fluff, no loss of quality.

РусскийEnglishEspañol
AboutMediaContacts & supportPartnershipsFor Rights HoldersFAQTerms of ServicePrivacy Policy
Contacts: welcome@neurobober.com

We use cookies to personalize services and improve your browsing experience. If you don't agree, please adjust your browser settings.

© 2026. NeuroBober