Live data from Hacker News

Nginx vs. Apache in AWS

blog.celingest.com

21–30 of 44 posts

Re: Nginx vs. Apache in AWS

#21
I think one of the less obvious conclusions here is how important caching is for wordpress, both with nginx and apache. I wish this test also covered W3 Total Cache though. I know it's hard to test all possible permutations.

One of the biggest issues with wordpress in particular however, is that whilst it can run with nginx happily, it is written primarily with Apache in mind. And many plugins rely on it too. I got it to work fine with nginx, but it somehow still felt rather experimental. Perhaps it's just me.

I wrote a similar post from a slightly different angle, comparing the cost/benefit of adding different caching layers. This included W3TC and varnish on both apache and nginx, and using a cheap shared hosting. http://blog.gingerlime.com/2012/how-much-cache-is-too-much/

Re: Nginx vs. Apache in AWS

#22
It's posts like this making it to the frontpage (and the inevitable comment thread) that make me sad about what HN has become.

What happened to the idea of making submissions (and comments) cost karma points anyway?

Re: Nginx vs. Apache in AWS

#23

"Here is a benchmark that shows the performance of a watermelon and a large canteloupe lobbed from a trebuchet using different kinds of wood and rope under different wind conditions. We tied random weights to each melon for no apparent reason." What the fuck is the point of a performance benchmark if you didn't tune any settings for performance ?

Indeed - this doesn't tell you anything. Was nginx configured well? Was apache? How much difference would it have made? Is the old apache version relevant? Pointless test, unless you intend to use those settings on that software on similar hardware.

Re: Nginx vs. Apache in AWS

#24
post #23

"Here is a benchmark that shows the performance of a watermelon and a large canteloupe lobbed from a trebuchet using different kinds of wood and rope under different wind conditions. We tied random weights to each melon for no apparent reason." What the fuck is the point of a performance benchmark if you didn't tune any settings for performance ?

Indeed - this doesn't tell you anything. Was nginx configured well? Was apache? How much difference would it have made? Is the old apache version relevant? Pointless test, unless you intend to use those settings on that software on similar hardware.

Agree, you can only compare both, if both are tuned for optimal performance for the specific situation.

Re: Nginx vs. Apache in AWS

#25
post #15

Earlier quoted context omitted.

I wouldn't call Debian Sta(b)le fair testing. Ubuntu is a slightly better but to be truly fair you should use the latest stable production branch of each program. Or dev if that's what you're testing.

The parent argued that the comparison is unfair, but those are the versions you would get from Debian (apt-get install nginx-light apache2)

Well, the title is "Nginx Vs Apache in AWS", not "Nginx from apt-get Vs Apache from apt-get in AWS". If you can't install the latest stable releases, then don't write a comparison about them.

Re: Nginx vs. Apache in AWS

#26
Disclaimer: I work at AWS, I'm not speaking for my employer. I also helped write Apache httpd, and I'm not speaking for Apache either. Just on my own behalf.

The Apache configuration in the benchmark isn't great, using values of;

  MaxClients         400
  MinSpareThreads     25
  MaxSpareThreads     75 
  ThreadsPerChild     25
means that Apache will be doing extra work to spin up and spin down threads in response to the load. It's best to keep everything static, e.g.

  MaxClients         1000
  MinSpareThreads    1000
  MaxSpareThreads    1000 
  ThreadsPerChild      25
That way there aren't additional clone() calls when under load (when you least need it), the maximum concurrency is the same. For a fairer fight still, the event mpm could be used.

Apache has nearly 20 year old configuration defaults - because it's best not to break things on users who rely on them. Properly configured, and sanely built, Apache can easily perform as well as nginx or lighttpd. These days 99% of web-server performance is in the kernel and the SSL/TLS libraries. The user-space code is almost completely irrelevant (and those configuration knobs I mentioned really just control how often certain system calls are called).

But it hardly matters; "apt-get install nginx" just works, and you really don't have to worry about it; you get a relatively small binary with some sane defaults. Apache is awesome, but I run nginx on my own EC2 micro instance. It's less hassle.

Re: Nginx vs. Apache in AWS

#27
post #23

"Here is a benchmark that shows the performance of a watermelon and a large canteloupe lobbed from a trebuchet using different kinds of wood and rope under different wind conditions. We tied random weights to each melon for no apparent reason." What the fuck is the point of a performance benchmark if you didn't tune any settings for performance ?

Indeed - this doesn't tell you anything. Was nginx configured well? Was apache? How much difference would it have made? Is the old apache version relevant? Pointless test, unless you intend to use those settings on that software on similar hardware.

Hell, it would have been great if they had used a real closed testbed on a local network instead of AWS. That would give you reproducible test results that aren't influenced by things like communal server resources and a communal network.

Regardless, they put zero thought into what makes each application work to its peak performance and just picked two random configurations, probably based on defaults that we know to be poor on Apache and advantageous on nginx. Using worker instead of event just adds insult to injury.

Re: Nginx vs. Apache in AWS

#28
post #25
post #15

Earlier quoted context omitted.

The parent argued that the comparison is unfair, but those are the versions you would get from Debian (apt-get install nginx-light apache2)

Well, the title is "Nginx Vs Apache in AWS", not "Nginx from apt-get Vs Apache from apt-get in AWS". If you can't install the latest stable releases, then don't write a comparison about them.

I don't know what versions are provided by the "amazon Linux AMI" (which the article cites as the image) but I would venture to guess that those are probably the standard (which would make the title apt)

Re: Nginx vs. Apache in AWS

#29
post #22

It's posts like this making it to the frontpage (and the inevitable comment thread) that make me sad about what HN has become. What happened to the idea of making submissions (and comments) cost karma points anyway?

[deleted]

Re: Nginx vs. Apache in AWS

#30

"Here is a benchmark that shows the performance of a watermelon and a large canteloupe lobbed from a trebuchet using different kinds of wood and rope under different wind conditions. We tied random weights to each melon for no apparent reason." What the fuck is the point of a performance benchmark if you didn't tune any settings for performance ?

What do you mean what is the point ?

The obvious assumption with all software is that it is optimised out of the box.

Post reply on HN