Go for Infrastructure
Backpressure in Go: operational verification
Explain how a buffered channel holds queued work, why a large buffer is a hidden queue, and how blocking, dropping and rejecting handle a full buffer.
What you will be able to do
- Explain how buffer depth and drain rate set the wait time for queued work.
- Decide whether a full buffer should block, drop or reject work, and why.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Go for Infrastructure
- Worker pools: operational verificationAdvanced · 4 min
Explain how a worker pool shares a jobs channel, why the sender should close a channel, and how a done channel stops blocked sends at shutdown.
- Bounded concurrency: failure analysisAdvanced · 4 min
Explain why a goroutine for each item needs a semaphore acquired before the go statement, and how to size a limit against a shared resource.
- HTTP server timeouts: failure analysisAdvanced · 4 min
Explain which net/http Server timeout covers each phase of a request, and how a missing read timeout lets slow clients hold file descriptors for long periods.
- net/http transport: operational verificationAdvanced · 4 min
Explain what Client.Timeout covers in net/http, why the default client can hang on a silent server, and how transport limits narrow down the stalled phase.
- Connection reuse: failure analysisAdvanced · 4 min
Explain why HTTP/1.1 connections are persistent by default, and how response bodies that are not closed stop connections from returning to the idle pool, so new ones…