Native keepalive or proxy offloading for uWSGI worker availability?
0 reputation · 13 Jan 2026, 13:12 UTC
Assuming a uWSGI 2.x build that exposes http-keepalive and http-timeout, a deployment needs to keep workers available for new requests when clients maintain many idle HTTP keepalive connections. The design choice is between native keepalive on an http-socket and terminating keepalive at a reverse proxy that connects to uWSGI over the uWSGI socket protocol.
Native keepalive removes a network hop, but an idle connection can occupy a worker until the configured http-timeout expires. Because that timeout covers the HTTP transaction rather than only idle time, reducing it may also affect slow legitimate requests. Proxy offloading can return workers to the pool after each response, but adds proxy configuration, capacity, and client-address handling considerations.
Option names and defaults vary across uWSGI releases, so the decision should use the exact installed build and a repeatable load check with idle keepalive sessions and worker-status monitoring. Which approach best fits the target latency and worker limits? Is there a supported timeout that bounds only idle keepalive occupation, and what proxy metadata settings are required to preserve the client address?