Apache 2.4 Takes Direct Aim At Nginx
darthcamaro writes "The world's most popular web server is out with a major new release today that has one key goal — deliver more performance than ever before. Improved caching, proxy modules as well as new session control are also key highlights of the release. 'We also show that as far as true performance is based — real-world performance as seen by the end-user- 2.4 is as fast, and even faster than some of the servers who may be "better" known as being "fast", like nginx,' Jim Jagielski, ASF President and Apache HTTP Server Project Management Committee, told InternetNews.com." Here's list of new features in 2.4.
That's all i could say.
So, your claim is that software can never improve?
Get off the rant, you were too stupid to figure out Apaches awesomeness so it spit you out, NginX took you in as it takes everyone in.
I struggled with Apache 2 for at least 4 years before switching to NginX. It was the best thing I ever did.
Quick translation into English: 'I am too clueless to run a webserver, but wish to get First Post'.
I'm old enough to remember when discussions on Slashdot were well informed.
I struggled with Apache 2 for at least 4 years before switching to NginX. It was the best thing I ever did.
Care to elaborate? I'm faced with that decision right now.
I have been running Release Candidiates of Apache 2.4 for a few months, on an underpowered and overloaded old laptop. The performance improvements over 2.2 on that same computer are really quite noticeable.
Does this release fix one of Apache's biggest problems, that the default Apache config file assumes that you've got 10 gigabytes of RAM in your server? Stuff like setting maxclients to a default of 150 has got to be the single biggest cause of Apache servers blowing up at dedicated and virtual private server hosts.
"We also show that as far as true performance is based - real-world performance as seen by the end-user- 2.4 is as fast, and even faster than some of the servers who may be "better" known as being "fast", like nginx," Jagielski said.
What's with the quotes? Other servers have proven to be faster, lighter weight, and more scalable than Apache for a long time. Don't be bitter because you fell behind. Be happy that you're finally catching up.
You must be nginx with such a fast response.
The truth is, nginx IS lightningly fast. It has its place, just like Apache.
But dear Apache foundation, please spend your money in making the things instead of making people believe you make things.
I use Apache Server with mod_jk.so to redirect requests to Tomcat and mod_ssl so that Apache Server is responsible for channel encryption. If you have to do something like that your best bet is Apache Server, not Nginx.
You can't handle the truth.
Quick translation into English: "I like my sendmail-esque configuration just fine. It's job security."
We need a fully async web server, like nginx, but with *full* support for fastcgi/http1.1 and connection pooling to the backend servers.
In case some people don't know, nginx uses http1 to connect to the servers, which means a new connection for reach request. Same thing for FastCGI. nginx opens a new FastCGI connection for each request, then tears it down once done, even though FastCGI supports persistent connections and true multiplexing.
nginx is awesome and I love competition, especially between opensource.
I think this is a fairly common sentiment towards Apache from developers who have to deploy their own stuff. I've certainly been in that camp more than a few times in the past. We're talking about:
- RAM usage
- Just being slow to push out simple files
- mod_php being the worst thing ever written
- mod_python disproving the last statement and taking the crown
- Various FastCGI/WSGI toolchains just not being up to scratch either.
I moved to nginx and Cherokee and suddenly configuration was both compact and modular and the settings seemed to make a real difference. RAM usage is completely minimal and performance is scorchingly hot. In more than one case I took an Apache box, switched Apache out and we were using half the RAM for the same jobs, and getting better performing websites, with less configuration.
I'm certain Apache could have been tuned but I don't think it's unreasonable for a developer to blame the software if you have to do a three year BSc in Apache Administration just to get something equivalent to 30 minutes playing in nginx.
I truly do hope that things are improving (competition is key in this environment!) but now I've left Apache on multiple servers, they're going to need to do more than just say "If you tune it, it can now match nginx speed", because my time is valuable too. I'm not going to jump back in until for most deployments it "just works".
The number one webserver is now going after the #2 webserver.
Interesting trend.
What a stupid thing to say. Nginx can do both of these tasks (SSL endpoint, reverse-proxy) well...probably even faster.
What, precisely, is "sendmail-esque" about the Apache configuration? If you're writing your httpd.conf in m4, you're doing it wrong.
I'd rather have better control features, such as completely redoing the vhost matching method.
now we need to go OSS in diesel cars
Nginx is not only the performance, it's also the configuration syntax ; everything looks much more professional, concise, and logically designed.
The code also deserves a special mention: it's like when you look under the hood of your car/computer for the first time, where everything is clean, all cables are numbered and arranged meticulously. This is a good old C code that doesn't need extra comments to be understood.
Apache improved? Show me the comparison charts between Apache and Nginx, in a many-users multi-cores-cpus and loaded configuration. To be honest, even if Apache would be a bit faster using a bit less memory than Nginx (while I have some doubts about that), I'd still be reluctant to go back to Apache and its setup.
Slashdot, fix the reply notifications... You won't get away with it...
Anonymous Coward switching to NginX would prove software can improve. The question is, does it need to be done by rethinking and starting over from scratch.
now we need to go OSS in diesel cars
Okay, I'm not clueless. Apache works for some people, but not for me. I find Nginx to be much stabler and easier to configure all the way around.
BTW, I don't read Slashdot enough to do the First Post thing. I wasn't even aware that mine was until you pointed it out.
Isn't mod_jk obsolete?? I thouht you are supposed to use mod_proxy_ajp, especially behind SSL...
Looks like there's much hand-wringing all over the net about what the MaxClients should be but the only place I've seen someone actually propose a method for computing it for a given load (in terms of throughput and service time) is here . Nice to see someone actually rolling up there sleeves and actually applying some theory to the problem.
IANA web admin, but from what I have learned from playing around with both Apache and Nginx is that they serve different markets.
Nginx is a small, fast, reliable web server that is great for virtual machines, home users, newbies (like me), etc. It is simple and "just works" because it make sense. Nginx is the Ubuntu/Mint of the web server world.
Apache is a massive, feature rich, highly tunable, beast that can inter-operate with everything. This is an enterprise class (or at least very serious workload) web server. Designed by people who know what they are doing for people who know what they are doing. Apache is the Slackware/Gentoo of the web server world.
If you need a web server to get a job done, use Nginx. If the web server is your job then Apache. The key is how much time you have to spend figuring out how to customize Apache just right vs. how much those customizations are worth.
I struggled with Apache 2 for at least 4 years before switching to NginX. It was the best thing I ever did.
You struggled to use Apache?
I appreciate you telling me this. You've enlightened me to add something to my hiring practices. Now I know to ask a simple Apache configuration question when I Interview someone. I definitely don't want to hire someone that has trouble using something as simple as Apache.
I'm certain Apache could have been tuned but I don't think it's unreasonable for a developer to blame the software if you have to do a three year BSc in Apache Administration just to get something equivalent to 30 minutes playing in nginx.
I truly do hope that things are improving (competition is key in this environment!) but now I've left Apache on multiple servers, they're going to need to do more than just say "If you tune it, it can now match nginx speed", because my time is valuable too. I'm not going to jump back in until for most deployments it "just works".
What makes you think that extremely complex piece of software is supposed to be easy to setup, by just about everyone?
Developers can do their development on default setup, I don't see a problem with that.
If you need to use it on production setup (or replication of production setup), then get people who know what they're doing to configure it.
Oh come on guys!
Every software has it's place to run. httpd, IIS (sorry for mentioning this one), lighttpd, tux, nginx,
Still comparing? Go buy 1 GB more RAM. Or say "sorry, It's easier for me to work with nginx, because apache is too heavy for my brains".
How much more RAM does it take for high loads than nginx?
[root@node3 ~]# ps_mem.py |grep -E "RAM|httpd|php"
Private + Shared = RAM used Program
202.6 MiB + 50.1 MiB = 252.7 MiB httpd (190)
940.2 MiB + 831.4 MiB = 1.7 GiB php-cgi (189)
Private + Shared = RAM used Program
This is what I've got with > 250 req/sec @1.6GHz dual cores, 8GB RAM. what more can nginx give and for what?
Average: all 2.35 0.00 2.08 3.24 0.00 92.33
If you are running it as a balancer - you're wrong! Take LVS.
If you are running it as a filter - you're wrong! Take mod_security or appliances (most of them are based on httpd+mod_security+mod_proxy) - nginx can't do this.
For anything else - it doesn't matter - you're wrong, again.
1 GB RAM vs delay + reading books, code and googling.
Maybe default manner of apache configurations and default MPM's are too heavy for you with default modules and features?
If you are running it for performance and response delays - Yes, it will be slower than nginx with single dumb empty virtual host with 0 add ons. You just CAN'T do analysis of traffic, filtering without buffering it. So, good servers will always have delays. It's OK for internet, not critical. Using it not for internet? For backend? Then OK.
I'm happy with 2.2 too.
Yes, I do like some nginx tricks and I wish it to be in apache too, but I'll never say that apache cannot handle something or do something or eat more RAM. It depends how do you configure it with your CPU and RAM resources, optimize.
"It feels like I'm at the Zoo when reading this thread - I'm frightened, but it's interesting" (c)
I don't think anything is as bad as sendmail, but I'm assuming he's referring to some rather obtuse configuration options in httpd.conf. The first thing that comes to mind are the psudo html tag blocks, that are nothing like anything else in httpd.conf. I think another problem is that every apache install I've seen (that I didn't set up myself) was basically the default config with every module enabled and stuff tossed in or commented out in a spaghetti clusterfuck.
We run MOD_PHP with Apache 2.2, should we expect to have MUCH lower memory usage - currently the servers have 8GB of memory and are limited by huge memory per apache connection.
+1. Really, it's not even about performance or that Apache guys are bad at software. Far from it. The real crux is that Apache has become the Kitchen Sink of webservers. It can do *anything*, and there's always a complexity cost for that. Nginx can't do everything, but it's a really efficient and minimalist implementation of what 97% of modern deployments actually need, and none of the things they don't.
In some meta-sense, all software goes through this cycle: You're the best, everyone uses you, everyone files niche feature requests, you actually implement all of the niche features, and next thing you know 10 years later you're the Kitchen Sink implementation of domain X, and someone comes along and throws out all the irrelevant bullshit and makes a leaner implementation of just what matters *today*.
IMHO, the answer is that dropping features needs to be as easy as adding them. Too many software projects/architects have an easy-in, hard-out policy on features. "We can't drop feature X, it's been there for years and some crazy people in siberia still use it". It's ok to drop features on major-cycle releases. Perhaps even necessary for long-term project health.
Nginx has an AJP module, but it is third party.
It doesn't support jk/ajp, but HTTP is supported.
I definitely don't want to hire someone that has trouble using something as simple as Apache.
Holy crap, do you even use Apache? At my job, I get to roll my own from source and I own every line of httpd.conf and each of our vhosts.
Simple is not the word I would use to describe it. "Specialized" is much more like it.
I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
I think that may speak more about the sort of jobs you get hired for and the people you work with, rather than Apache itself.
The Apache configuration layout that Debian uses combined with Puppet or Chef is goodness.
That seems like link spam to me. Lots of useless posts with little substance.
Throughput and service time has little to do with MaxClients, other than if you set MaxClients too high your server will swap to death or run out of memory in high concurrency situations- and then throughput and service time drop rock bottom.
Figuring out MaxClients isn't that difficult. Set MaxClients to something high first, then use ab2 (apachebench) or similar to do X concurrent requests of your most bloated page (serving static pages won't use much memory, it's stuff like php and modperl that use more memory).
Now increase X till apache (and other associated stuff[1]) is using the maximum memory[2] you want on that server. X is now the upperbound of what your MaxClients value should be. You may wish to set MaxClients lower than that as a safety measure, in case a popular web page one day uses more memory, or your other services on that server use more memory.
Now your server won't fall over. There's nothing you can do to make a small server handle 1 million requests within 1 second, but the correct MaxClients setting means your server won't fall over when that happens (unless you have crap hardware or drivers).
[1] Your apache webapp might be using other services/servers on that server and that stuff might also use more memory as the concurrent connections increase.
[2] Calculating memory usage can be a bit tricky, but you can count shared memory in an apache process once, the rest is nonshared.
The sure way is to increase concurrency till it swaps, to detect whether the server is starting to "swap" you can use the "page out" statistics (you can get it for Linux and Windows). If you have lots of page-outs the server is "swapping".
No, nginx is slower when talking to Apache Tomcat than Apache server is, check your mouth at the door.
You can't handle the truth.
My biggest problem with Apache is configuring it. The configuration file is simply a mess. You have overrides that can be included from other files, etc. Even using Webmin doesn't make the configuration that much easier.
If I mod you up, it doesn't necessarily mean I agree with what you've said, sorry.
Apache isn't the application, it the platform that applications are running on... there are many exampled for complex under the hood but easy to manage platforms..
The issue is that the "Default" setup is not performing as well as the "Default" of another product offering the most of the same services.
Not sure what IT department you work in, but many have been cut all to hell in the last few years meaning fewer Experts can be hired and your a left with a small team trying to do everything.
EA David Gardner -"... but the consumers have proven that actually what they want is fun."
Nginx is WAY faster for the same system resource and it's easier to configure.
I'm not saying apache is bad, just nginx is better. I'll not be going back to apache.
bah bah bah, you so stupid me so smart meh meh meh.
Idiot.
What's missing in this debate is the fact that Node.js Is Bad Ass Rock Star Tech.
Faith is a willingness to accept something w/o complete proof and to act on it. Reason allows you to correct that faith.
Apache is "simple" in the same way that PHP is: it has excellent documentation because it has to or else no one would ever be able to use it. I've been using it professionally since the late 90s and am reasonably happy and comfortable with it, but I still have to RTFM every time I want to do something non-trivial.
Dewey, what part of this looks like authorities should be involved?
What makes you think that extremely complex piece of software is supposed to be easy to setup, by just about everyone?
What makes you think everyone needs an extremely complex piece of software when their needs are often quite simple?
Apache is big and complex, nginx is small and simpler. Often one works better than the other for a particular person's needs. If someone finds Apache difficult to set up and finds nginx to be easier, then telling him to get someone to set up Apache is not the answer since he already already has the answer he is looking for. If Apache wants to be that answer too, then they need to find a way to simplify configuration.
I appreciate you telling me this. You've enlightened me to add something to my hiring practices. Now I know to ask a simple Apache configuration question when I Interview someone. I definitely don't want to hire someone that has trouble using something as simple as Apache.
The problem isn't with "simple Apache configuration", the problem is when a manager thinks that only simple apache configuration directives are needed to set up their site to be secure, scalable, and stable. That's often not the case with Apache.
Congratulations, you posted in this thread without calling some other poster names! Oh, wait, you're first post. D'Oh!
I just wish they'd fix the syntax for the AuthLDAPUrl Directive so that you could specify unencrypted binds on a local socket and failover to encrypted binds over the network. It's the basic use case for well-structured large networks, which will have a local LDAP slave for speed and a central node somewhere else on the LAN.
I do love apache, though, warts and all. Great software.
What about using PHP-CGI on apache without mod_php?
"It feels like I'm at the Zoo when reading this thread - I'm frightened, but it's interesting" (c)
mod_jk isn't obsolete, by far. If you're talking to a bunch of JVMs and need to perform routing that isn't supported in the three mod_proxy_balancer options (and runtime reconfiguration), mod_jk is a good choice. Two JVMs, round robin? mod_proxy_ajp, for sure.
I think that a lot of the mod_jk users may go to either mod_proxy or mod_cluster as it matures.
Indeed the config is a bit of a mess. Although most distributions have made it much more modular and easier to maintain, the psuedo html doesnt really work that well. It feels inconsistent and verbose.
Plus you lose the secure flag in HttpServletRequest if you don't use AJP proxying, so then you have to do some kind of stupid header hack or a second port or IP to provide the Java runtime with knowledge that your channel is secure (unless you are running 100% SSL, which isn't a bad thing imo).
Slashdot is proof that Sturgeon's Law applies to mankind.
Historically Apache hasn't been great when it comes to performance. I run a number of busy web applications and having migrated from Apache to Lighttpd and then to a combination of Lighttpd and NginX I can tell you that everyone espousing Apache simply hasn't had to scale. Apache is fine you are running one or two servers with minimal load, beyond that is when you start to see problems.
You can easily do tens of millions if not hundreds of millions of light requests per month with minimal scripting and a bit of MySQL of a single core i7 box. If that is your scenario you simply won't understand what people are talking about when they say the performance sucks.
When I switched I had over a dozen web servers serving billions of high workload requests per month. During peak usage times load would peak, back logs would increase, and response was starting to slow. We had our own custom Apache source tree and were constantly conducting experiments to tune and tweak the configuration. We used Lingerd and all sorts of complicated tricks and tweaks to squeeze every last drop of performance. Then, as a test, we switched to Lighttpd, default configuration, and guess what? Load absolutely plummeted. We dropped Apache like a bad habit. That was years ago and we have probably saved $100k in hardware and time since... Now we actually spend our time optimizing our Applications and never worry about what the web server is doing.
Snotty team heads rejoice.
Yup see mongo vs RDBMs. Same thing.
Frankly unless you are doing something very specialised with your app, Apache is probably what you are looking for and even if you are doing something very specialised it can probably take a creditable stab at it.
Deleted
Second this - I've grown to prefer Cherokee (ridiculously easy configuration, as fast as nginx, and 'copylefted' as well), though I have no complaint using nginx as well (I'm using nginx on a virtual server running an Ubuntu release that seemed to be having some trouble with cherokee with php-fpm for reasons I wasn't able to figure out.)
Hacker Public Radio is our Friend
Apache is essentially the "sendmail" of web servers...
Hacker Public Radio is our Friend
The new kid on the block is way faster.. G-WAN has more bang for zero bucks.. Don't believe me..go benchmark the latest build against nginx or apache.. johnny!!!
The performance hit for doing that is pretty bad - any time you hit a .php file the system has to go start up a new PHP interpreter program. (This isn't specifically a PHP thing, plain old-school cgi is the slowest way to run anything that needs an interpreter).
I've gotten quite fond of php-fpm (an "internal" implementation of a fastcgi provider included with PHP), and as a bonus once it's set up, you can switch between cherokee, nginx, apache, lighthttpd, etc, or even some combination of them at the same time as long as they support fastcgi, without needing to do anything else to PHP configuration.
Hacker Public Radio is our Friend
I don't know why anyone listens to assholes like you. "I never had a problem so you must suck enough to be pinned to the shit of the profession" bullshit isn't a valid retort at all. It is bullying in hopes to win your online cock-affirmation.
"When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
I didn't switch to lighttpd, and then nginx just because of performance.
It was, in part, because of configuration. As some Anonymous Coward trolled earlier on, the configuration syntax is pretty pretty complicated, and there are some multisite configurations which are imposible to achieve. It's really a mess, and not-too-well documented.
I have very few servers, each with several sites, with TLS and SNI, and some need to be redirected to others, some are matched with a regex to get some resources from one place, and other resources from some other application on a socket.
This took a few hours the first time with nginx, a few days with lighttpd, but I could *never* achieve this with apache's httpd!
I definitely don't want to hire someone that has trouble using something as simple as Apache.
Holy crap, do you even use Apache? At my job, I get to roll my own from source and I own every line of httpd.conf and each of our vhosts.
Simple is not the word I would use to describe it. "Specialized" is much more like it.
'Special' is how they refer to the kids on the short bus as well (and Palin's and Santorum's kids).
Jesus was all right but his disciples were thick and ordinary. -John Lennon
The performance hit for doing that is pretty bad
Why? nginx is also using CGI interface. Everything's the same.
any time you hit a .php file the system has to go start up a new PHP interpreter program.
Actually it depends on php side, not the web server:
php-cgi - you configure how many processes you want to have
php-fpm - automatic
"It feels like I'm at the Zoo when reading this thread - I'm frightened, but it's interesting" (c)
I don't think the op was saying that, just that switching to nginx was a significant improvement over Apache.
At one place I worked, I increased our server capacity by 3 times, simply putting nginx in front of apache as a reverse proxy. Another place I replaced apache with nginx and cut memory requirements by over half. There are some things nginx doesn't do well, but nginx is so good at what it does it's still worth using the two together.
From my reasonably extensive experiences with both, Apache comes across as a slow lumbering juggernaut designed to do everything, no matter the cost, whereas nginx was designed with nothing but speed and efficiency in mind.
I'm sure Apache can improve, but short of a total rewrite reflecting a change in their approach, I'd be doubtful it can overtake nginx.
Yaws is a webserver written in Erlang that does 80,000 concurrent connections.
Apache and Nginx only see the dust trail...
Which is demonstrably utter horse shit. You'll note the irony in accusing me of being the one who is apparently playing the "everyone but me" card, yet he's the one who wrote that parenthetical "that I didn't set up myself" cock-wave.
Got that? Good.
I wish I could mod the Kitchen Sink comment up more as it hits the nail on the head. Another example is when someone used to say, "I'm going to make a small fast text editor not like those bloated things," and you could cue forward a few years to the editor which changes description from "fast and light," to , "full featured." It seems to be natural to pretend that there aren't tradeoffs.
This is all just my personal opinion.
Having experienced the easy in never out thing I have to add some sentiments to this:
when you expand a framework to include more features you always end up doing
various abstractions, expansion endpoints, etc... these things once in can't be
removed without effectively rewriting the whole application or a big part of it. The
problem with partial rewrites is that they usually get quite complex if you want to cut
out exactly all the cruft and usually end up in failures.
So - more or less - get it over with. Either do a blank sheet rewrite or just start a
secondary de-crufted project. That is software evolution and it won't change.
-- no sig today
What for? In the name of what? With such approach, when breaking feature-level backward compatibility, you'd give lots of people (not only "crazy people in Siberia") loads of pain since they would be forced to devise a strategy for getting rid of/replacing those deprecated features.
On the other hand, the model of "old things become outdated, new things emerge, some people stick with the old and are happy, some jump onto the new stuff because it suits them better" works quite well IMHO. It's the natural way the world works. Including nature, civilization, science, technology and so on. Do you imply that there's something wrong with that and we should artificially force some change upon those who are unwilling to take it?
The mistake is trying to use mod_php with a heavy PHP application, such as a a complex Drupal site, without a reverse proxy such as Varnish or nginx.
One trick I have been using for a few years is using Apache as a threaded server, with MPM Worker, and FastCGI but with fcgid, not mod_fastcgi. Works exceptionally well. For static files, Apache is now lightweight and does not use much RAM.
For details, see my article on Apache MPM Worker with fcgid.
2bits.com, Inc: Drupal, WordPress, and LAMP performance tuning.
I struggled with Apache 2 for at least 4 years before switching to NginX. It was the best thing I ever did.
Why is this flamebait?
CGI and FastCGI aren't the same. CGI is indeed very slow. FastCGI is pretty good.
I vaguely remember seeing some benchmarks that claimed Nginx+FastCGI/PHP has roughly the same performance as Apache+mod_php.
It is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail. - Abraham Maslow