Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: lighttpd or nginx for a low grade server?
19 points by zeeone on March 22, 2009 | hide | past | favorite | 14 comments
I've been looking into lighttpd and nginx for a server with low memory. I'm somewhat familiar with lighttpd, but there is an online rumor that it has memory leaks. I'll serve mostly static pages and some FastCGI pages. Any advice on which one to use would be greatly appreciated.

[Note: I moved here from Reddit and I don't think I'm going back there anymore. Reddit is becoming the new Digg]




I've used Lighttpd, Cherokee, Nginx and of course Apache (although stripped down for speed) on a high load production site for serving static files and reverse proxying.

Nginx wins no contest. Highly stable, serving for almost 2 years now with zero issues.

Lots of features, much simpler config, uses less resources.

Hot config reloading. Hot binary upgrading.

Low grade? Hardly.

Issues with others:

Lighttpd - configing slightly annoying, uses more cpu and memory

Apache - slow performance and memory hog even when stripped of all it's extra modules, (just try and support 5000 keep alive connections on it)

Cherokee - very nice, well thought out and featureful and fast but had some stability problems in production, I may take a look at it again later on because it has a sweet admin interface


Many thanks for all answers so far!

I talked to a Ukrainian programmer and a friend of mine, who said he knew the guy who programmed nginx. He said that nginx was designed as a load balancer for Apache. I've been reading its docs for two days now and I can't find anything like that, but then again most of the docs are in Russian. Am I missing something? Is nginx a stand alone server or an addition to Apache?


English Docs are here: http://wiki.nginx.org/Main - the site used to be wiki.codemongers.com but it is now under nginx.org


It's standalone. Nginx really shines as a reverse proxy, but it has an fcgi module that can be used to do that as well.


nginx hands down. nginx is probably the most stable piece of software with the least problems we run here at engineyard. We've had thousands of nginx instances in production for years now and I can truly say it is one of my favorite pieces of software.


I second this recommendation, except on a vastly smaller scale. My uptime currently reads about 530 days. My wee little nginx has not needed a restart in the entire time, except for reloading configuration files. This is through, and this is a back of the envelope number, probably 20 million HTTP requests.

It is far and away the most stable software I've ever seen (at least, among non-trivial publicly-accessible pieces of software).

It also has memory requirements which are low enough that some Japanese toilet seats probably qualify.


To add my voice to the chorus: Nginx, hands down. It's a great piece of software - simple enough to configure, small and efficient, and it just works and keeps working. I have literally never seen it crash or do anything it wasn't supposed to do.

As for lighttpd, I messed with it a while ago and while it has its advocates, I found it fiddly to install and configure and quite old-fashioned. The arrival of nginx means you don't really need to consider lighttpd, IMO, it's kind of the older, worse version of the same thing.

However ...

Your other option is of course just sticking with Apache. I don't know the details of your server (maybe should have said?) but it doesn't use that much memory! For many common scenarios using it could be quite a bit easier. Well, it would likely be no work at all actually, since it's probably already installed and running fine. There can be a tendency to over-optimise up front; why not take the path of least resistance, get something up and running with Apache first, then switch if and when you need to? Just a thought ;)


I'm not a heavy user of nginx although I've read more than I care to about all of the various options lately.. and my single data point is that nginx would be the better option of the two right now.


Have a look at mathopd: http://www.mathopd.org/. Very lightweight and stable/mature, and unlike lighttpd, an excellent security track record.


I thought about trying it out, but as far as I can tell it doesn't support regex url matching.


mathopd is not scalable, because uses select for connection multiplexing. With many connections, CPU load is many times higher, than for nginx or lighttpd (where epoll/kqueue used). I suggest to use nginx instead mathopd.


I'm uninclined to credit this sort of assertion without seeing application-specific benchmarks, and even less-so when the OP explicitly states that his application is memory-bound. On how many websites is system call overhead actually the limiting factor that prevents scaling?


I use Apache Web Server on a four year old server. It hasn't gone down outside of two server moves. Coming from the Java application server and IIS worlds, it's seems pretty simple to me. It seemed to be a more widely supported choice amongst my customers, and thus worth my time to invest in learning it.


look on forums, let's say on slicehost: many people uses both of them, there are lots of comments there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: