NGINX as a high performance reverse proxy
summary
Shows how to run open-source NGINX as an SSL reverse proxy serving 10k+ simultaneous connections and even stress-tested to ~50k by combining NGINX proxy_pass to backend app servers (Gunicorn/CherryPy), event-driven workers sized to CPU cores, and worker_connections ≈ 10,000. Details include raising OS file-descriptor limits (ulimit/sysctl), increasing ephemeral port range, lowering TCP TIME_WAIT, tuning listen backlog, keepalive limits, sendfile, caching and SSL offload to cut backend CPU. Results: reliable at scale after those kernel and NGINX tweaks.
AI-written summary · about
chapters (19)
- 0:00Introduction to NGINX
- 1:26What is a reverse proxy
- 3:32Why NGINX is fast
- 5:42Basic NGINX setup
- 6:48Load balancing methods
- 7:31Optimizing NGINX performance
- 8:57File descriptor limits
- 10:44TCP backlog and ports
- 12:08TCP TIME_WAIT timeout
- 13:11Keep-alive connections
- 13:53Upstream keep-alive
- 14:16Compression and caching
- 14:58Security and SSL
- 16:27Cipher selection
- 16:48HTTP/2 benefits
- 17:30Rate limiting
- 17:52Logging and performance
- 18:15Socket sharing
- 19:23Q&A
