Skip to main content
KUTT REDIRECTEDGE LAB // REDIS 302 RPS & POSTGRES PARTITIONING STUDIO KUTT V3 + SHLINK ROADRUNNER | HOSTINGER KVM | VULTR HIGH FREQUENCY | 2026-10-27
KuttLinkVPS
KuttLinkVPS Affiliate Notice: Outbound /go/ links marked rel="sponsored" may earn a partner commission at zero added cost (Affiliate Policy).
Redirect & DB Tuning

Nginx & Caddy Upstream Keepalive Tuning for 301/302 Latency

Eliminate ephemeral port exhaustion and TCP handshake spikes at 5,000+ req/s using HTTP/1.1 upstream keepalive pools and proxy buffering tweaks.

keepalive 64 · Zero TIME_WAIT Exhaustion · -3.2 ms Tail

Nginx & Caddy Upstream Keepalive Tuning for 301/302 Latency
Shortener telemetry baseline verified 2026-10-27 by RedirectEdge Lab.

Fixing the 15,000-Port TIME_WAIT Wall

By default, Nginx opens a fresh TCP connection to Kutt or Shlink for every incoming redirect and closes it immediately. Above 1,500 req/s, Linux exhausts the local 28,000 ephemeral port range inside 60 seconds of TIME_WAIT sockets.

Configuring Persistent Upstream Connection Pools

Adding keepalive 64 inside the upstream block alongside proxy_http_version 1.1 and an empty Connection header reuses persistent loopback sockets and cuts p95 redirect jitter by over 3 milliseconds.

Measured Thresholds & Shortener Stack Parameters

Proxy DirectiveDefault BehaviorHigh-RPS Tuned Value
upstream keepaliveNew TCP socket per redirectkeepalive 64; proxy_http_version 1.1;
proxy_set_header ConnectionCloses upstream socketproxy_set_header Connection "";
TLS Session TicketsFull handshake on burstsTLS 1.3 + 24h session cache
keepalive 64 · Zero TIME_WAIT Exhaustion · -3.2 ms Tail Deploy Hostinger KVM ($4.99/mo)Vultr HF NVMe