Live data from Hacker News

Nginx vs Apache performance

blog.webfaction.com

41–49 of 49 posts

Re: Nginx vs Apache performance

#41
post #31
post #8

Earlier quoted context omitted.

Depends on the app platform. In the rails world Phusion Passenger (aka mod_rails or mod_rack) in combination with Apache is making inroads for serving up dynamic content. Despite the bigger footprint and other downsides of Apache, I'm hearing more and more that stability and ease of configuration of Passenger are a win. I'm only running it on a low usage backend app for the moment, but it was definitely easy to set u…

Passenger is a big win. I once ran nginx + mongrel_cluster, and while it probably had less overhead than the equivalent Apache + Passenger setup, it was more than cancelled out by the effort necessary to babysit the mongrel processes. This was also more of an issue with MRI-era Ruby and its associated memory leaks. With Passenger, I set it and forget it. Time is money.

I agree.

I've been using NGinx/Mongrel for most of my large deployed apps, but am working to get things moved to Passenger (and Apache, natch), simply for the ability to do a graceful restart on most code changes. For large apps, the ever expanding mongrel footprint and slow restarts is becoming too much to bear.

So for me, Nginx has a lot to offer over Apache, but with the rails deployments I've been working on mostly, it's no longer enough.

Re: Nginx vs Apache performance

#42
post #6

Earlier quoted context omitted.

There's no need for Lighttpd when you use Nginx. It can do everything that Lighttpd can do and more (and has no memory leaks).

Interesting... Our app is Python 2.5 and Django (well, kinda Django). I haven't gotten to deep into the Lighttpd thing yet, but it looked promising. Maybe I should take another look at Nginx? Also, do you recommend FastCGI or WSGI? I've had a hard time figuring out precisely what the differences in implications are.

Definitely nginx with FastCGI for Django. At my previous company it drove all the 30+ sites.

Re: Nginx vs Apache performance

#43

One of the things about nginx is the lack of an organised community - for e.g. there is not even an official repository for nginx ( http://marc.info/?l=nginx&m=122153991029203&w=2 ). there are simply some mirrors of people who maintain a patch-based tree ( http://mdounin.ru/hg/nginx-vendor-current ). There is no bug-tracker (!!), just a wiki page ( http://wiki.nginx.org//NginxBugs ) and as someone mentioned ( http://…

i think much of this is due to the language barrier, and also due to the ease of use (and ease of writing nginx modules)...

the lack of a bug tracker and a SCM should'nt be limited by language barrier.

Re: Nginx vs Apache performance

#44
post #22

What is the optimal solution for PHP-based sites? Is Apache w/ mod_php faster than Nginx with FastCGI?

Anecdotes are not data, but if you're in the market for an anecdote anyway...

A thousand times no. Nginx+php-fastcgi is screamingly fast by comparison, while allowing me to free up about 70% of the memory previously in use, and get huge gains from loading the PHP code into RAM with APC.

I look after one managed server which chucks out tens of millions of requests per day despite only having half a gig of RAM in it. Before, running apache2, it had a load average of about 6.0. Now? 0.2.

Re: Nginx vs Apache performance

#45
post #36
post #32

Earlier quoted context omitted.

I've found that nginx still performs around 10-15% better than haproxy. I was using the stable version of haproxy, so they may have improved speed with the experimental versions. One nice thing about nginx is that it can use local unix sockets instead of ports for load balancing. The downside of nginx is that you'll have to compile your own -- most Linux distros come with an ancient version of nginx that actually is…

Yeah, the new version of haproxy has been shown to be able to hold up on a 10Gbps connection with no problems. We're using 1.3.15.2 with a couple of patches from the experimental version.

well holding up the 10Gbps connection isn't the problem really, i don't think it manages the balance pool as effectively as nginx. I don't believe haproxy supports unix domain socket balancing either.

Re: Nginx vs Apache performance

#46
Interesting. Another nice choice for serving static content is rumored to be thttpd. It lacks any kind of FastCGI support though (it's in the proprietary,premium version). Has anyone had any experiences of thttpd versus nginx?

Re: Nginx vs Apache performance

#47

One of the things about nginx is the lack of an organised community - for e.g. there is not even an official repository for nginx ( http://marc.info/?l=nginx&m=122153991029203&w=2 ). there are simply some mirrors of people who maintain a patch-based tree ( http://mdounin.ru/hg/nginx-vendor-current ). There is no bug-tracker (!!), just a wiki page ( http://wiki.nginx.org//NginxBugs ) and as someone mentioned ( http://…

If your architecture is designed such that changing the web layer is hell, you probably should reconsider the architecture. Your other points stand. The channels of communication around nginx are not as clear and robust as Apache.

Re: Nginx vs Apache performance

#48

Earlier quoted context omitted.

Interesting... Our app is Python 2.5 and Django (well, kinda Django). I haven't gotten to deep into the Lighttpd thing yet, but it looked promising. Maybe I should take another look at Nginx? Also, do you recommend FastCGI or WSGI? I've had a hard time figuring out precisely what the differences in implications are.

FastCGI for no particular reason other than it's worked for me straight off using a couple different Python versions and Django. I also use nginx as proxy in front of apache and dev instances of django manage.py runserver (nginx serves up static, passes dynamic on to back ends) Nginx is so powerful, flexible, and has never given me a single problem. I loves it.

Wow. This was brain freaking dead simple to configure compared to Apache and even simpler than Lighttpd. Thank you a million times over! It works great!

Re: Nginx vs Apache performance

#49
post #8

My understanding is that Nginx is the server of choice for static content and Lighttpd for dynamic content (particularly FastCGI). Is that still the latest and greatest advice? I've found Lighttpd way easier to configure than Apache and am having it serve my static content simply because we don't need to worry about every little bit of performance just yet.

Depends on the app platform. In the rails world Phusion Passenger (aka mod_rails or mod_rack) in combination with Apache is making inroads for serving up dynamic content. Despite the bigger footprint and other downsides of Apache, I'm hearing more and more that stability and ease of configuration of Passenger are a win. I'm only running it on a low usage backend app for the moment, but it was definitely easy to set u…

Phusion is also available for Nginx.
Post reply on HN