What are the advantages and disadvantages between Apache and Nginx?

Asked

Viewed 19,909 times

22

I see a lot of people recommending Nginx on Apache [HTTP Server], and I can well understand why the first is Event-driven it brings advantages as to scalability (i.e. low memory consumption under heavy load) compared to the approach process-based of the second. But I’m not sure about its disadvantages, or cases where Apache would be a better solution. Citing for example this site (that talks a lot about Nginx but almost nothing about Apache):

Apache is like Microsoft Word, it has a million options but you only need six. Nginx does these six things, and five of them 50 times faster than Apache.

What situations then would Apache be the best solution? Or: what are the main points of difference between them, which can be key to the choice between one and the other in a given situation?

1 answer

11

I believe that the experience in the use of each of these servers is fundamental.

Any of them can easily be "bogged down" by Addons and soon lose performance, as well, especially Apache, can be clean and have high performance.

I’ve been working with Apache for years, and I don’t change it. I have servers with different purposes and achieved performance similar to those released by Nginx, and still keeping years of experience and away from abstraction leak.

Well, my suggestion is: The two are good, so if you have no experience in either of them, you can choose anyone, and it even seems to me to be a better option the Nginx, however, I do not advise trading one for the other, only for performance indicators disclosed by the evangelists, after all, problems like the C10k problem have long been solved by Apache but are still used as an argument in the talks on Nginx.

I’m on the team that thinks "Old pot makes good food" :D

But let’s get to the numbers:

Grafico de desempenho 1

Grafico de desempenho 2

For smaller file delivery, Nginx performs better in high-volume requests, while PHP processing looks better in Apache 2.4

Image source: http://blog.corujadeti.com.br/nova-versao-do-apache-2-4-2-versus-nginx-fight/

  • 2

    I miss an explanation about "what are the main points of difference between them [...]", as requested in the question...

  • If you evaluate Views you will always find the items "Performance", "Security" and "Scale" as differential. Take an example: http://blog.corujadeti.com.br/nova-versao-do-apache-2-4-versus-nginx-fight/

  • 1

    I wanted to say that I miss in the context of this site, without having to go to another site to learn something new, but thanks for the reference ;)

  • See the issue with the inclusion of numbers

  • This graph with the/second requests with PHP does not say whether mod_php or Fastcgi was used. Should this not be taken into consideration? If not, why?

  • Yes, it should be taken into consideration if you choose to use PHP after this performance study. But these details you can question in the IT Owl blog that ran the tests, okay? A hug!

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.