Ask HN: lighttpd or nginx for a low grade server?
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]
15 comments
[ 4.2 ms ] story [ 27.5 ms ] threadNginx 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
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?
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.
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 ;)