Why one engineer still chooses NGINX for high-traffic production over simpler alternatives
A software engineer deployed a production system on a single Hostinger KVM2 VPS with 2 vCPU and 8 GB RAM, successfully handling load tests of 2,500 requests per second with zero errors and a p99 latency of 308ms. The architecture placed NGINX as the sole internet-facing entry point, routing API traffic to an Express and Prisma container and frontend traffic to a Next.js container, both bound to localhost. NGINX's built-in rate limiting was highlighted as far more efficient than application-level alternatives, since rejected requests never reach Node.js, avoiding event loop and memory overhead. The engineer also used NGINX's proxy_cache_lock directive to prevent the thundering herd problem, ensuring only one upstream request fires on a cache miss while concurrent requests wait and are served from cache. A key configuration detail involved restoring real client IPs from Cloudflare headers to ensure per-user rate limiting worked correctly rather than targeting shared Cloudflare edge IPs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in