Apache 2.4 Faster Than Nginx?
31–40 of 44 posts
Re: Apache 2.4 Faster Than Nginx?
#32Re: Apache 2.4 Faster Than Nginx?
#33Oh 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?
#34ServerLimit: In combination with ThreadLimit, this sets the maximum configured value for MaxRequestWorkers. Default is 16.
ThreadLimit: The maximum configured value for ThreadsPerChild for the lifetime of the Apache httpd process. Any attempts to change this directive during a restart will be ignored, but ThreadsPerChild can be modified during a restart up to the value of this directive. Default is 64.
ThreadsPerChild: The number of threads created by each child process. The child creates these threads at startup and never creates more. Default is 25.
MaxRequestWorkers: The limit on the number of simultaneous requests that will be served. Any connection attempts over the MaxRequestWorkers limit will normally be queued, up to a number based on the ListenBacklog directive. Default value is ServerLimit multiplied by the value of ThreadsPerChild, e.g. 400.
ListenBacklog: Maximum length of the queue of pending connections. Default varies by OS, on linux I think it can't be larger than /proc/sys/net/core/somaxconn
AsyncRequestWorkerFactor: Tunes the event MPM's concurrent connections per process. See http://httpd.apache.org/docs/2.4/mod/event.html Default is 2.
Re: Apache 2.4 Faster Than Nginx?
#35Oh 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.
This MPM tries to fix the 'keep alive problem' in HTTP. After a client completes the first request, the client can keep the connection open, and send further requests using the same socket. This can save signifigant overhead in creating TCP connections. However, Apache HTTP Server traditionally keeps an entire child process/thread waiting for data from the client, which brings its own disadvantages. To solve this problem, this MPM uses a dedicated thread to handle both the Listening sockets, all sockets that are in a Keep Alive state, and sockets where the handler and protocol filters have done their work and the only remaining thing to do is send the data to the client.
Re: Apache 2.4 Faster Than Nginx?
#36Earlier quoted context omitted.
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.
It is good not to presume anything when dealing with technology.
Re: Apache 2.4 Faster Than Nginx?
#37Note 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…
Re: Apache 2.4 Faster Than Nginx?
#38Note 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…
This. Good grief, what a leap of logic this entire benchmark is.
Re: Apache 2.4 Faster Than Nginx?
#39Note 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 th…
Next, if you want to test the PHP interfaces, you can do that, but this test setup was perfectly adequate for testing the speed of the daemon. (once the configuration issues are handled)
Re: Apache 2.4 Faster Than Nginx?
#40Apache 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…
That is not the right way to load test. You're not trying to determine how many pages a single client can request from a server. You're trying to isolate the performance variable. To do that, you test from a machine on the same network. The resulting values are how many requests the server can handle in a given period of time, regardless of how those requests get to the server.