4 ms·
"So i'm still an apache httpd guy , can you sell me nginx in 3 simple points ?" (actually i'm using it already , i need to sell it to my boss).
by camus 13y ago
"So i'm still an apache httpd guy , can you sell me nginx in 3 simple points ?" (actually i'm using it already , i need to sell it to my boss).
- gexla 13y agoYou probably don't need to. Apache is good enough and if you have to sell your boss on using Nginx then you probably don't have enough need to switch. It should sell itself or you are probably just wasting your time. I use Nginx because I find it easier to configure and more lightweight out of the box.
- iso8859-1 13y agoIt's simpler, easier to configure, has event-driven "magic" :). But seriously, you can google this and it doesn't make sense to sell HTTP servers like toothpaste anyway. Just be absolutely sure that you never need the additional features that Apache Httpd provides, and Nginx will probably be a good choice. Read http://stackoverflow.com/a/3635081/309483 http://stackoverflow.com/a/3635081/309483 There is also a linked 100+ vote question, but I think it has too much noise. I'm an Apache guy too. If you know how to configure it, there's not much reason to switch from Apache.
- harshreality 13y agoBeing able to run a site using less memory on average, and much less memory in the worst case (traffic spike for a site running a dynamic language module like mod_php), is a major reason to switch to Nginx from Apache.
- iso8859-1 13y agoApache 2.4 has reduced memory usage, are you sure this still applies? Nobody is forcing you to use mod_php, in fact I'd say it's obsolete. I use PHP-FPM.
- njharman 13y agoIf your using it already, why do you need to sell it?
- seunosewa 13y agoIts more efficient. It uses far less RAM when handling a lot of concurrent connections.
- InclinedPlane 13y agoApache was designed in an era where the webserver did everything, and most of what it was doing was serving static content. And the fundamental design of apache as well as the design of its configuration system is optimized for that. And though it's been modified extensively to do everything a modern web server needs to do in many ways it's still held back by that heritage. Also, apache is fairly monolithic. The way to add functionality to apache is generally with modules, for example, and generally a random apache installation is going to have vastly more features active than you may actually need, or want. All of which affects performance. Nginx was written from the ground up in the modern web era, when we had already learned about the common ways that real websites worked (dynamic, high throughput, tied into other technology like php or rails, possibly living on multiple servers, etc.) Nginx is designed for efficiency and low overhead. It's also designed to live within an ecosystem rather than live as the container of an ecosystem, at its heart it's not a web-server it's a proxy. And all of this makes nginx easier to set up, easier to configure, and generally more efficient with superior performance compared to apache. Here's an example. I have a server set up with a couple different sites, some of them are fronted by varnish (for caching), several run on php, and another runs on rails. With nginx this is all fairly easy to do. Instead of installing modules as you would tend to do with apache you set up php and rails as standalone socket-based servers (e.g. php-fpm and unicorn) and then in your nginx configuration you simply tell the web server where those are and how to use them. Nginx also funnels you into a pattern which makes it easier to scale. Because nginx is just part of an ecosystem and not the container of an ecosystem you can easily migrate components to other servers as necessary. In my example I could push varnish off to another server, push each php app off onto its own server, push rails off onto separate servers, etc. The configuration changes would be fairly minimal and it would all still just work.
- smcnally 13y agoNice. After many years of apache, I, too, already use nginx. This is helpful, still. "funnels you into a pattern" is especialy good. Thank you.
- 1SaltwaterC 13y agoI'd argue a little with the "Apache is monolithic". If you know your elbow from your butt, you can make a decent Apache setup as any decent sysadmin should do. The thing that I hate the most in nginx is the lack of DSO modules. When I need a new module, I need a new nginx build. nginx itself has more than you ask for in a standard build. As example, I counted the "with" and "without" flags from out nginx package build script. It has 3 "with" flags (SSL, gzip static, PCRE JIT) vs 14 "without" flags. And we can part with gzip static since most of the static objects are pushed by CDN's now. Apache is catching up with its evented MPM and proxy support, but I still wouldn't go back to Apache though. The main selling point that the OP should get is the fact that evented servers have much better memory usage under the same load as the threaded servers or (cough) process based servers.
- lobster_johnson 13y agoIt's not so much switching to something qualitatively better than to something with a somewhat different style. For example, Apache is chock full of modules with a certain richness to them, they do everything and everything you could possibly think of, with a verbose configuration that usually comes filled with "defaults" by the maintainer, and plenty of options to choose between processes and threads; Nginx is "lean and mean", strictly event-based and minimalistic in almost every way, is usually compiled to include just what you need (and still feels un-monolithic despite modules being statically compiled), comes with sensible defaults and is usually bundled with almost no config. Some rough analogues: Nginx is to Apache what (Varnish, Postfix, Go, Git) is to (Squid, Exim, C++, Subversion).
- zimpenfish 13y agoI can accept Git >> Subversion and Varnish >> Squid but I'll take you on with sticks and pillows over Postfix >> Exim because that's entirely nonsense, sir, and I WILL NOT HAVE IT.
- lobster_johnson 13y agoIt's not ">" as much as "<->", ie. not a statement about quality. I know a lot of people love Exim. The reason I included Exim is that it's a huge monolithic chunk (at least as I remember it, it's been a while) with a very long history (and lots of legacy quirks), whereas Postfix is designed from the beginning to be modern and modular.