Does NGINX or Apache benefit from a server that has either:
-
Multi-cores, or
-
Multiple processors?
If so, why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using several CPUs/CPU-Cores gives server applications the opportunity to process several client connections (and requests) in parallel (achieving higher performance).
In a world of multi-Core CPUs, the question has been subject of extensive research.
There are 3 ways of addressing parallelism (like multi-Core CPUs):
using several processes;
using several threads in a single process;
using several threads in several processes.
Apache has explored several models, and Nginx is using option #1.
Which model performs better is generally considered as being a matter of implementation (at least under Unix where processes are very light so they can compete with threads).
Now, back to the question my guess (based on reading tests published here) would be that the proper (multi-thread) Apache architecture should scale better than Nginx on multi-Core CPUs.
Paradoxally, it does not mean that Apache is faster than Nginx: it just means that on 1, 2, 3, … 16 Cores, Apache would scale better than Nginx WHILE Nginx would process more client requests:
Performance is to be fast (processing more requests per second on a single-Core CPU)
Scalability is the ability to process more requests per seconds as the number of CPU Cores grows (the ideal is to scale linearly: doubling the requests per second as you double the number of CPU Cores).
Scaling without performance is pointless if the number of requests per second of the server which scales is inferior to the speed of the server which does not scale (note that if the server REALLY scales well, there’s a point where having MANY Cores should make it perform better than the server that does not scale).
Performing without scaling is making a server unable to take advantage of multi-Core CPUs.
The future will certainly be made of server applications which do both correctly, to provide the best performance under all conditions (just a few Cores or many-many Cores).