python
8 minFastAPI Backpressure: Protecting Your Service from Unbounded Fan-Out
A practical guide to request concurrency, connection pools, timeouts, and overload behavior in async Python APIs.
Loading page...
python
8 minA practical guide to request concurrency, connection pools, timeouts, and overload behavior in async Python APIs.
Q&A
Q&ABound concurrency and queue depth at the scarce resource, and enforce an end-to-end deadline.
Use bounded connection pools, semaphores or worker queues, request deadlines, and deliberate overload responses. Local limits must account for replica count because each replica has its own pool. Avoid unbounded in-memory tasks and retries that amplify load during an incident.
python
8 minFastAPI is fast, but speed is not the same as correctness. Learn where async, background jobs, and bounded concurrency matter in Python services.
Q&A
Q&APacket direction and handshake behavior help locate whether loss occurs before or after the destination.
Capture narrowly at the client and, if possible, server. A SYN leaving without a reply suggests routing or filtering; a reset indicates an active rejection or no listener; a completed handshake moves investigation toward TLS or the application protocol. Packet captures can expose sensitive metadata or payloads, so limit capture scope and protect files.
Q&A
Q&AUDP has no connection handshake and applications may not answer an invalid or empty probe.
Unlike TCP, UDP does not establish a transport connection before sending a datagram. A missing response can mean filtering, packet loss, an invalid request, or an application that does not reply. Use a valid protocol-level health check and capture at sender and receiver when diagnosing the path.
Q&A
Q&ACorrelate GC logs, allocation rate, live-set size, pause phases, and user latency before tuning.
Enable and inspect unified GC logs for pause duration, cause, heap before/after, promotion, and allocation behavior. Correlate with request latency and container memory. A large live set, allocation bursts, humongous objects, or memory pressure can imply different fixes; tune collector flags only after identifying which resource or workload pattern drives the pauses.
unix
11 minDiagnose connection failures by separating DNS, routing, transport, listening sockets, and application protocol behavior.
Q&A
Q&AThe connection attempt left the observed point, but no response returned there.
It narrows the investigation but does not identify one root cause: route failure, filtering, destination outage, asymmetric routing, or capture at the wrong interface can all look similar. Capture at both ends, check socket listeners and network policy, and correlate with route and firewall telemetry.