Performance tuning
Guide
Performance & socket tuning
Buffers, Nagle, keep-alive, backlog, streaming and timeouts — what to touch and what to leave.
The proxy exposes the socket and connection knobs that matter under load. The defaults are tuned for low latency and high concurrency, so most deployments never change them — but when you are chasing tail latency or a very specific traffic shape, these are the levers.
- Latency —
nodelay,proxy_nodelay,nonblockingkeep small messages flowing without Nagle delay. - Throughput —
recv_buffer_sizeandsend_buffer_sizesize the kernel socket buffers. - Concurrency —
max_backlogbounds the accept queue;proxy_keepalive_secreuses upstream connections. - Large/slow responses —
enable_streamingstreams bodies instead of buffering them.
⚠️Measure first
These settings interact with your kernel and NIC. Change one at a time and measure — blindly inflating buffers or backlog can hurt as easily as help.