
Apache operates in "prefork mode," employing a predetermined quantity of processes, each dedicated to handling one request at a time, whether static or dynamic.
In contrast, NGINX takes an asynchronous approach toward requests. A single NGINX process can effectively handle numerous concurrent requests, limited only by the available system resources.
Unlike Apache, NGINX does not integrate server-side languages directly into its processes. Instead, NGINX forwards these requests to an external process, such as PHP FPM, for server-side processing.
NGINX excels at delivering static files rapidly, with the server-side processes remaining oblivious to this operation. Conversely, Apache handles all resources with server-side overhead, leading to a greater consumption of server resources compared to NGINX.
Performance
NGINX: Swift Handling of Static Resources
NGINX: Support for Higher Concurrent Requests - Capable of managing thousands of requests on a single thread.
Apache: Serves requests up to a pre-configured limit, rejecting any exceeding requests.
NGINX wins!
Configuration
- NGINX prioritizes URI locations, while Apache favors file system locations as a primary consideration.
About the author
I am a DevOps Consultant. 3 years experience with Cloud technologies. 9 years total IT experience in the Linux, Networking and Data Visualization domains. Love listening to music and playing older PC games.
Comments
Join the discussionNo comments yet. Be the first to comment.
Configuring NGINX
In this basic level series, I will post best practices to configure the NGINX web server using Linux based instances.




