4 ms·
I'm curious how many people here choose Nginx over Apache. If I have a choice in my stack, I will always choose Nginx but all too often if I'm doing work for so
by mattwdelong 15y ago
I'm curious how many people here choose Nginx over Apache. If I have a choice in my stack, I will always choose Nginx but all too often if I'm doing work for someone else, they always demand Apache. I think it's because it's the "defacto standard" and tends to be well known among less technical people. I'm sure the same situation goes for people who prefer PostgreSQL over MySQL.
I guess my question being, how would you convince people to use your favorite stack, and sometimes the best service for the job, such as Nginx/PostgreSQL, when all they know is the most popular services. Sometimes, just convincing them it's the best for the job is not enough.
- bad_user 15y agoApache is easier to configure and provides a bunch of useful plugins that Nginx doesn't. It's more trustworthy in a shared-hosting environment too.
- TylerE 15y agoI'd argue the opposite. I find nginx config much more flexible, and compact.
- mattwdelong 15y agoI agree, that's one of the reason why I choose it. I love the config file structure, and feel it's actually much quicker to get a new host up and running on nginx over Apache.
- bad_user 15y agoThen try configuring/running mod_wsgi for nginx.
- TylerE 15y agohttp://www.rkblog.rk.edu.pl/w/p/hosting-django-under-nginx-scgi-and-wsgi/ http://www.rkblog.rk.edu.pl/w/p/hosting-django-under-nginx-s... Doesn't look bad at all. ~10 required lines, all of which are just telling nginx how to call wsgi and what params to pass. Very similar to the apache config to do the exact same thing.
- bad_user 15y agoIt's not the same - you have to compile Nginx with mod_wsgi support. It's not as simple as doing an "apt-get install nginx" and it may compile with your version, or it may not compile. Also, read this: http://blog.dscpl.com.au/2009/05/blocking-requests-and-nginx-version-of.html http://blog.dscpl.com.au/2009/05/blocking-requests-and-nginx... mod_wsgi is an interesting example. Surely it has the wrong architecture for Nginx and something better could surely be written. But mod_wsgi for Apache simply kicks ass, being a server that manages everything for you with low overhead and good performance caracteristics. No need for supervisord or any of that crap. Some people go as far as recommending running Nginx in front of Apache, with all the overhead that brings, just for mod_wsgi (although the same could be said about mod_php). That's the thing about Apache - it's so mature and has so much traction that you can find quality plugins for anything and everything, being an all you can eat buffet. But then if you're going to put Nginx in front of Apache, why go with Nginx instead of Varnish: http://www.varnish-cache.org/ http://www.varnish-cache.org/ -- which is designed from the ground-up to function as a high-performance proxy cache (the Nginx plugin for proxy caching sucks donkey balls IMHO) What I'm trying to say here is that Nginx is very far from a one-size-fits-all. It's awesome for at least one website I've got written in Ruby on Rails and I'm using it in combination with Passenger (Ruby's mod_wsgi). But for all my other use-cases, I'm starting with Apache first, then reconsider the move to Nginx or not.
- mattwdelong 15y agoI use fastcgi, and it's a painless deploy + configuration as far as I'm concerned.
- sofuture 15y agoRecently tried to choose nginx -- Mono fastcgi is a trainwreck though, and mod_mono works well enough. I'll switch to nginx as soon as that situation changes.
- rbranson 15y agoThe choice of nginx vs Apache over MySQL vs PostgreSQL is not an equal comparison at all. Until the application hits very high hit rates, the web server choice is mostly inconsequential. RDBMS choice will have real impact on the developers from the outset.
- mattwdelong 15y agoThat's fair. I was merely looking for another comparison and the MySQL/PostgreSQL debate came to mind. I can't really think of anything that similarly compares to Apache/nginx.
- rbranson 15y agoLinux distributions? Usually not important until you're building your own packages or needing to heavily customize.
- Macha 15y agoDepends. At the very low end of hardware, it makes a big difference too. My VPS originally had 360mb RAM and Apache would fall over during traffic spikes. I switched to nginx and the problems went away. That said, someone who knows more about configuring Apache for performance likely would not have this problem. I'm just a developer throwing up a blog, however, and switching to nginx was quicker than figuring out how to make Apache work better.