Live data from Hacker News

Apache 2.4 Faster Than Nginx?

blog.zhuzhaoyuan.com

21–30 of 44 posts

Re: Apache 2.4 Faster Than Nginx?

#22

Oh hey, look. He set MaxRequestWorkers to 800. That means Apache can only process 800 connections at a time. I wonder if that will affect its performance in the benchmark.

heh, something tells me this guy will be updating his post based on all these comments. At least, I hope so.

Re: Apache 2.4 Faster Than Nginx?

#23
post #20

Note in captions: (static file) . He might as well have benchmarked Apache against an FTP server. Hitting the same HTML page/file over and over is not realistic. There is so much more to a web-server than this. What you absolutely must do is benchmark a dynamic PHP-driven, with MySQL access, website. Because that's what Apache is mostly used for (rarely for file serving). And I don't mean the first page only. But the…

Good point, but I don't think people only ever use Apache for PHP and MySQL.

I'm certain they don't, but it doesn't seem like a terrible lowest common denominator to me - certainly it'd be a better one than pure static file serving from the point of view of the workloads I normally deal with in production.

Re: Apache 2.4 Faster Than Nginx?

#24
post #2

I'd like to know where the reports are that Apache 2.4 was faster than Nginx. The test in the post hardly seems exhaustive; most web servers do more than serve up a 9kb file on the loopback address. I have to imagine, that the actual 'report' was that 'apache 2.4 is faster than nginx in certain situations'. This would certainly seem to back that up: http://mondotech.blogspot.com/2012/02/apache-24-vs-nginx-ben...

The disclaimer on that benchmark is beautiful - I very much appreciate both the degree of honesty about the applicability of the results and the reminder that the majority of benchmarks we as developers personally run suffer from exactly the same caveats.

Re: Apache 2.4 Faster Than Nginx?

#25

Note in captions: (static file) . He might as well have benchmarked Apache against an FTP server. Hitting the same HTML page/file over and over is not realistic. There is so much more to a web-server than this. What you absolutely must do is benchmark a dynamic PHP-driven, with MySQL access, website. Because that's what Apache is mostly used for (rarely for file serving). And I don't mean the first page only. But the…

"Note in captions: (static file)... This is not realistic."

It's reasonable if you're trying to test concurrent connection limits.

"What you absolutely must do is benchmark a dynamic PHP-driven, with MySQL access, website."

That's something nginx is also used for, and it's far from the only thing apache is used for. I agree that would be a useful benchmark, but it's not the only meaningful one.

"you've only proven that Nginx can handle more concurrent requests for a single static file vs. Apache 2.4 (which is something we all already know to be true)."

No, we didn't know this. This was testing apache 2.4's new event [0] MPM [1]. Arguably we still don't know this, since this apache configuration seems artificially limited and there's no comparison of the resource usage of apache and nginx.

[0] http://httpd.apache.org/docs/2.4/mod/event.html [1] http://httpd.apache.org/docs/2.4/mpm.html

Re: Apache 2.4 Faster Than Nginx?

#26
post #9

Apache is faster than NGINX. NGINX is faster than Apache. If that confuses you, then you don't understand http daemons. It's all about how you benchmark. This particular benchmark is 100% pointless and tells you nothing . He was performing the benchmark on one machine. In other words, all was local. You are never going to do that in production. What would be the point? In production, you have this thing called a netw…

Hahaha, holy jesus, I didn't realize he was running ApacheBench and the httpds on the same machine. That's insane just from a local resource starvation standpoint.

Re: Apache 2.4 Faster Than Nginx?

#27

Oh hey, look. He set MaxRequestWorkers to 800. That means Apache can only process 800 connections at a time. I wonder if that will affect its performance in the benchmark.

Throw in a big keepalive and on a short test you can make it so it only processes 800 requests! Awesome.

Lets try this with the worker mpm instead.

Re: Apache 2.4 Faster Than Nginx?

#28
post #9

Apache is faster than NGINX. NGINX is faster than Apache. If that confuses you, then you don't understand http daemons. It's all about how you benchmark. This particular benchmark is 100% pointless and tells you nothing . He was performing the benchmark on one machine. In other words, all was local. You are never going to do that in production. What would be the point? In production, you have this thing called a netw…

Yeah... I stated that in a previous comment but the whole software benchmarking news are often bullshit. I mean just look at the setup:

_ Single machine

_ Static files (seriously ?)

_ Incomplete or even incorrect configuration of Apache, I don't know for Nginx

But you know what ? That's always the same thing, people prefer to look at benchmarks, sit back in their chairs and have this immense satisfaction of not having started a project with that "slow/under-performing tool that is Apache, because Nginx is so much better". Whatever... It's really tiring.

If you were to build a real website, time delivery for static files you simply... do not care! And anyway that amount of data per sec, that rarely met. And if it's met, you rent a CDN for static content.

But as they say : "Benchmarkers are going to benchmark" (even if it's useless)

Re: Apache 2.4 Faster Than Nginx?

#29
post #9

Apache is faster than NGINX. NGINX is faster than Apache. If that confuses you, then you don't understand http daemons. It's all about how you benchmark. This particular benchmark is 100% pointless and tells you nothing . He was performing the benchmark on one machine. In other words, all was local. You are never going to do that in production. What would be the point? In production, you have this thing called a netw…

Hahaha, holy jesus, I didn't realize he was running ApacheBench and the httpds on the same machine. That's insane just from a local resource starvation standpoint.

Whatever the overhead of the benchmark tool, it would be the same for Apache and nginx, presumably, so can be factored out.

Re: Apache 2.4 Faster Than Nginx?

#30
post #27

Oh hey, look. He set MaxRequestWorkers to 800. That means Apache can only process 800 connections at a time. I wonder if that will affect its performance in the benchmark.

Throw in a big keepalive and on a short test you can make it so it only processes 800 requests! Awesome. Lets try this with the worker mpm instead.

Hell, let's get crazy and use event. I hear asynchronous connection handling is popular these days. http://httpd.apache.org/docs/2.4/mod/event.html
Post reply on HN