Nginx is an open-source web server designed for high-concurrency scenarios, serving as a reverse proxy, load balancer, and HTTP cache. It focuses on high performance and low memory usage by avoiding the overhead of creating new threads for every incoming connection.
How it works
The server utilizes an asynchronous, event-driven architecture. A small number of worker processes handle multiple connections simultaneously using non-blocking I/O multiplexing, such as epoll on Linux. This allows Nginx to scale linearly with the number of CPU cores without significant memory overhead.
It is commonly deployed as an edge server to deliver static assets, as a gateway for microservices architectures, and as an SSL termination point. Key features include:
- Load balancing with health checks;
- FastCGI, uWSGI, and memcached support;
- High-performance static file serving.
Nginx powers some of the world's largest platforms, including Netflix and Cloudflare. A basic setup can handle over 10,000 inactive HTTP keep-alive connections using as little as 2.5 MB of RAM, demonstrating its extreme resource efficiency compared to process-based servers like Apache.