News for hackers. Stuff that matters.
Re:Nginx vs Apache performance by snprbob86 on Monday March 16, 2009 @08:49PM (#519100)
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.

Re:Nginx vs Apache performance by pwk on Monday March 16, 2009 @09:21PM (#519160)
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 up.
Re:Nginx vs Apache performance by gamache on Tuesday March 17, 2009 @07:19AM (#519727)
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.

Re:Nginx vs Apache performance by zealog on Tuesday March 17, 2009 @01:05PM (#520133)
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 by tlrobinson on Monday March 16, 2009 @09:30PM (#519173)
Am I misunderstanding something, or is Phusion essentially just a slightly better FastCGI?

It does some magic sharing of read-only segments of memory by taking advantage of copy-on-write and a special version of Ruby, but other than that it seems like it does the exact same thing as FastCGI.

Re:Nginx vs Apache performance by pwk on Monday March 16, 2009 @10:19PM (#519253)
...is Phusion essentially just a slightly better FastCGI?

Well, it depends on whether you're looking at it from an academic or practical standpoint. AFAIK the technologies are not entirely dissimilar, as you suggest, but there are notable differences once you actually put them into use. I've used both for running rails apps, and a few things stand out for me:

1. Passenger is much easier to set up: it took me about 5 minutes to get my first Passenger based rails app up and running. The last time I set up a rails app w/FastCGI (admittedly a few years ago now) it took me much longer. This comes down to simpler configuration combined with better documentation. Subsequent application deployment is also easier (no manual server restarts required). This is worth a lot in practical terms, even if not flashy.

2. Passenger seems more stable. I never had quite the problems with FastCGI that others appear to have had, and I've only been using Passenger for a few weeks now, but there's a reason people used FastCGI less often once Mongrel became available.

3. Oh, and there's some neat stuff too: automatic spawning and pruning of application instances in response to demand, etc.

Re:Nginx vs Apache performance by sunkencity on Tuesday March 17, 2009 @05:20AM (#519636)
Yeah, the integrated monitoring in passenger really simplifies rails deployment a lot. It was always very tricky to shepherd the mongrels.
Re:Nginx vs Apache performance by cwells on Friday May 08, 2009 @03:01PM (#600081)
Phusion is also available for Nginx.
Re:Nginx vs Apache performance by nickb on Monday March 16, 2009 @09:07PM (#519132)
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).
Re:Nginx vs Apache performance by snprbob86 on Monday March 16, 2009 @10:15PM (#519246)
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.

Re:Nginx vs Apache performance by njharman on Monday March 16, 2009 @10:24PM (#519260)
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.

Re:Nginx vs Apache performance by snprbob86 on Friday March 20, 2009 @04:47AM (#524684)
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 by bandris on Tuesday March 17, 2009 @02:43PM (#520348)
Definitely nginx with FastCGI for Django. At my previous company it drove all the 30+ sites.
Re:Nginx vs Apache performance by jedberg on Monday March 16, 2009 @11:14PM (#519319)
We just use an http load balancer (haproxy) and have the app servers talk http directly. No need for a web server, which makes things much more stable. We use nginx for static content though (haproxy points at nginx for the static content).
Re:Nginx vs Apache performance by catch23 on Tuesday March 17, 2009 @07:56AM (#519747)
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 buggy in certain ways.
Re:Nginx vs Apache performance by jedberg on Tuesday March 17, 2009 @12:10PM (#520036)
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.
Re:Nginx vs Apache performance by catch23 on Tuesday March 17, 2009 @08:45PM (#520907)
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 by smallpaul on Tuesday March 17, 2009 @01:53AM (#519481)
How do you do process management? Do you have a static or dynamic number of app server processes/threads?
Re:Nginx vs Apache performance by jedberg on Tuesday March 17, 2009 @12:15PM (#520048)
Process management is done with a custom tool. In theory we could have a dynamic number of apps, but in practice it is static. Occasionally we have to take a few out of rotation, and haproxy handles it just fine.