Is Apache the new Firefox?

Date July 6, 2009

What, what?

No, I’m not crazy. Well, not much. Hear me out.

I didn’t put much thought into it until I read Paul Graydon’s excellent article on the rise and fall of Apache as the preeminent web server for the masses.

To be sure, Apache is still on top, and will be for some time. Likewise, many of the cognoscenti deem Firefox to be the premier web browser. Anyway, it seems to suck less than the others.

That in itself isn’t reason enough to equate the two, but lets examine some other similarities. Quick, which web browser is the most extensible though plugins and the like? Which web server gives you the most configuration options and extensibility through modules? As Paul mentioned, Apache is losing ground to faster, more lightweight options. Ditto for Firefox, who’s newest effort, 3.5 is almost as fast as Chrome. Both are solid, known-good platforms (with Firefox really only being rascally if you don’t restart it every couple of days, at least in my case). And yet both are being overtaken by smaller, more nimble offerings.

What does this mean for us as administrators? Well, in the short run, probably nothing. In the long term, it really means more options. According to Malcolm Gladwell, change can sometime happen suddenly, with a lack of apparent reason. The prevalence of technologies which work better under alternative platforms could very well be the leverage needed for Lighttpd to jump ahead.

I see less of an issue coming from the C10K problem. Websites are no longer 4k (or anywhere near to it), but as Paul mentioned, servers are constantly becoming more powerful, and nginx (which I just found out about, thanks to my recent issues) is fully capable of functioning as a front-end. From what I’ve read, nginx’s main strength is its blinding speed. Most off the suggestions I’ve heard recommend putting it in front of a more full-featured web service, but I’m very interested in hearing how you’re using it.

As systems administrators, we should be pragmatists. As pragmatists, we need to use what is best. For me (and several others), right now that means Apache, though possibly with an nginx proxy on front. In the future, who knows, but I think it would pay off to at least have Lighttpd on the radar.

« Previous Entry
Hilarious server room cooling story


Next Entry »
More press for my article

12 Responses to “Is Apache the new Firefox?”

  1. Ryan Nedeff said:

    While I’ve been away from Apache in enterprise for a year or two, I have to agree. Firefox is my browser of choice, but I’m currently running without any plug-ins or add-ons. My home system frequently becomes sluggish in heavy browsing sessions.

    Allthough I’m pretty loyal to Mozilla corp and Firefox, I can’t say I haven’t been thinking of checking out what else is on the market.

  2. Greg said:

    If you’re running nginx or lighttpd as a pure reverse proxy to apache without splitting or modifying the workload, I’m not sure you’d see big gains.

    Some alternative ideas to try out …

    1) Assuming you have another IP to burn, run apache and nginx side by side. Have one (or multiple) subdomains pointed at nginx for your static content such as images, pdf’s. If you spread the static across multiple subdomains, you might be able to trick browsers into making parallel requests to speed up render times.

    2) If you don’t have another IP to burn, you can perform a similar trick using nginx as a reverse proxy. Have nginx handle static files by itself, and reverse proxy non-static stuff to a apache (note, you may need mod_rpaf to fix your logs).

    3) Run your scripting language out of mod_fcgid. This works *really* well with PHP and mpm-worker Apache, as long as you can live with the limitations of PHP as a FastCGI (no PHP directives in .htaccess files is the big one — you can get around that by having an intelligent php.ini and/or overriding in code). This way, static stuff is handled by Apache as a thread, without bringing the overhead of PHP where it’s not needed.

    I’ve built more than a few Option 3’s in high load hosting environments, and I’ll be building a combo option-1-and-3 solution Real Soon Now ™.

    Ping me if you try one of these options out; I’d like to know how it turns out.

  3. Matt Simmons said:

    @Greg

    Thanks for enumerating those options. I think 3 looks like the best solution for my actual application, but I’m interested in playing with nginx more just to see what all the fuss is about :-)

    I’ll let you know once I implement one of them. Heck, I’ll probably post it here!

  4. Nick Anderson said:

    If your looking to do reverse proxy you might want to look at varnish. I have some friends who use it with great success for high traffic sites.

    Ive tested nginx vs apache for php in the past. I did not do extensive testing but nginx in my tests consistently had faster page loads and higher throughput in apachebench.

  5. Niczar said:

    Whatever you do, just put haproxy in front. You can thank me later.

  6. Matt Simmons said:

    @Niczar: Issues with haproxy?

  7. Niczar said:

    Works very well for me so far. It negates the need for moving away from Apache in many cases. It also protects against quite a few DOS. Logging is superb, so is load balancing and performance; but then I’m not using it myself on a high demand website, however users tend to agree on this.

  8. Paul said:

    @Greg

    The advantage of nginx isn’t purely from a speed perspective. I did some rough testing myself before I wrote the blog post linked to, and I did see some increase in speed when running ab on one desktop against my own requesting a static image (50,000 times, scaled concurrent connections up in tests from 1 to 50), even on multiple repeats of the benchmark.

    What is the most important benefit to me as a sysadmin is how lightweight it is, regardless of the number of connections. Unlike apache that uses more and more memory and resources, nginx and lighttpd remain nice and small. The more load a server is under the more the advantages of nginx type browsers come to matter. It means that I can get that much more out of a web server cluster than I could before for very little effort.

    It’s also worth thinking about what occurs with the pages you’re loading on your server, and considering the ratio of static to dynamic content on a site. On typical sites if you were to run something like these you’ll find there often aren’t that many dynamic calls, at least in relation to static. I’d definitely agree with you, in an ideal world I would split up static and dynamic content between sub domains, then have the appropriate webserver listening on appropriate ports/IPs for them. It’s much more elegant.
    Sadly isn’t always an option, particularly in my particular line of business. I work for a web hosting company, and I help design and implement custom solutions for customers. Trying to explain the need to split up content in different locations can often be tricky.

    There is an interesting blog here where someone demonstrates how they link nginx in to “WP Super Cache” so that if there is cached content that gets served straight away by nginx instead of proxying requests through to Apache.

  9. Paul said:

    It just occurred to me I don’t even need to persuade customers to split files, both subdomain and primary domain could be hosting the content from the same location as if it was a standard hosting solution, as long as the site designer knows to use “images.blah.com” in for any static content. Hmm.

  10. BOK said:

    Just to add some fuel to the discussion and various mentioned options: how about “Pound” URL: http://www.apsis.ch/pound/ compared to “nginx” and ” HAProxy”?

  11. Niczar said:

    I don’t know much about nginx and pound but here’s how it differs: haproxy doesn’t do caching, it’s mostly a load balancer, but with advanced layer 7 capabilities and very good logging. In my case I use it mostly to load balance and failover non-HTTP traffic.
    In effect it’s a very good replacement for LVS (kernel-based load balancing), but in user-mode (and with the same performance thanks to using the latest kernel API, vmsplice and all that).

  12. GigaGeek said:

    I know this discussion is largely around open source or free http caching / proxy type servers, so please don’t flame me for a comercial product plug.

    But BlueCoat has an amazing appliance that sits in this niche very nicely. I have used several of these over the years and their capabilities and features are hard to beat.

    Sorry for the comerical plug. I don’t often recommend a commercial product if I can help it, but this company and their product are top notch.

    Also, while a little off topic, they also have a great content filter solution free for home use. It is called K9

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Easy AdSense by Unreal