Apache vs Lighttpd
From WikiVS, the open comparison website
| Apache | Lighttpd | |
|---|---|---|
| | VS
|
|
| http://httpd.apache.org | http://www.lighttpd.net |
Apache and Lighttpd are open-source cross-platform HTTP servers.
Contents |
[edit] Architecture
Lighttpd is an asynchronous server. It runs as single process with a single thread and non-blocking I/O.
Nginx and Lighttpd are probably the two best-known asynchronous servers and Apache is undoubtedly the best known process-based server. [...] The main advantage of the asynchronous approach is scalability. In a process-based server, each simultaneous connection requires a thread which incurs significant overhead. An asynchronous server, on the other hand, is event-driven and handles requests in a single (or at least, very few) threads.
While a process-based server can often perform on par with an asynchronous server under light loads, under heavier loads they usually consume far too much RAM which significantly degrades performance. Also, they degrade much faster on less powerful hardware or in a resource-restricted environment such as a VPS.
Pulling numbers from thin air for illustrative purposes, serving 10,000 simultaneous connections would probably only cause Nginx to use a few megabytes of RAM whereas Apache would probably consume hundreds of megabytes (if it could do it at all).
[edit] Stability
As of August 2009, lighttpd still has unsolved memory leaks issues reported 3 years ago.[1]
One problem with Lighty is that it leaks memory like a sieve. I audited it for a little bit and I gave up, it's a mess. I'd steer clear of it, it will quickly ruin your day if you throw a lot of traffic at it.
— Bob Ippolito in the TurboGears mailing list, 2006-08-24
[edit] Performance
[edit] Features
[edit] Virtual Hosts
Both Apache and lighttpd support virtual hosts, but lighttpd cannot separate error logs per virtual host and there are no plans to implement this feature [2]. All errors go into the server's error log file [3].
[edit] FastCGI
Apache has support for FastCGI.
Lighttpd has support for CGI and FastCGI via module. [4] Not only can it retrieve pages from CGI/FastCGI processes, it can automatically spawn them. [5]
[edit] Memcached
[edit] X-Sendfile
Lighttpd suports X-Sendfile since version 1.5.
Apache 1 does not support X-Sendfile. For Apache2, there is a 3rd party module.

del.icio.us
digg
Furl
reddit
Slashdot