Why you should select Nginx for your Magento Server solution

Posted by ksaltik in Magento on 9 October 2014 with No Comments

Why you select Nginx for web server solution?

Without getting into too much technical detail I willl try to explain why Nginx better choice for especially for Magento Hosting.

Apache uses high amount of memory and CPU cycles when dealing with high amount of simultaneous HTTP/HTTPS connections. And this results in very high consumption of RAM. Every Apache child process uses around 100 MB of RAM and in a standart Magento installation on a dedicated server with 16 GB of RAM only and nearly can handle just 150 concurrent request only.
The major difference between Apache and Nginx are, Apache is process-based on the contrary Nginx is event-based  So Nginx don’t require any new processes or threads to increase its level of concurrency and this result in very low memory footprint.

If you ever get an experiemnce with Nginx you should now that in its configuration file you pre-configure the number of worker processes. Non-blocking, event-driven architecture of Nginx allows a single worker process to handle requests by multiple clients and each process operates as single isolated process.

On Nginx Wiki it is stated that;

Nginx is one of a handful of servers written to address the C10K problem. Unlike traditional
servers, Nginx doesn’t rely on threads to handle requests. Instead it uses a much more
scalable event-driven (asynchronous) architecture. This architecture uses small, but more
importantly, predictable amounts of memory under load.
Even if you don’t expect to handle thousands of simultaneous requests, you can still benefit
from Nginx’s high-performance and small memory footprint. Nginx scales in all directions:
from the smallest VPS all the way up to clusters of servers.

When all these factors take into consideration we see that Nginx can handle 10.000 HTTP/HTTPS requests per second just 10 to 20 MB RAM and with 10% to 15% average CPU usage. HTTPS request CPU usage will increase of course because of the HTTPS encryption/decryption routines are very CPU intensive.

Leave a Comment

Your email address will not be published. Required fields are marked *

LoadingRetrieving latest tweet...

Back to Top

2018 © Oney Hosting LCC © 2014 All Rights Reserved.