Lighttpd vs nginx

From WikiVS, the open comparison website

Jump to: navigation, search
Lighttpd Nginx
Lighttpd
VS
Nginx
http://www.lighttpd.net http://wiki.nginx.org

Lighttpd and ngnix are open-source HTTP servers for the *nix platform. Both are very configurable and fast, and are lightweight compared to Apache.

Contents

Performance

nginx is noted to be a good server for sites that need fast, efficient reverse proxies [1], [2], [3] or fast, efficient serving of static content [4]. It is acclaimed for having low memory usage and is recommended for sites running on a VPS.

"It seems that Lighttpd might perform best in a more fragmented file system (smaller files)."
CPU consumption by nginx seems to be less than that of lighttpd.
-- [5]

Features

Both Lighttpd and nginx support modules that enhance functionality. They try to balance the number of built-in modules for performance reasons.

IPv6

Lighttpd has had support for IPv6 for a long time.

IPv6 support for nginx is in the works.

Backends

Lighttpd has support for CGI [6], FastCGI [7] and SCGI [8] via modules.
Lighttpd is capable of automatically spawning FastCGI backends as well as using externally spawned processes.

nginx has module support for FastCGI via a built-in module, SCGI and WSGI via 3rd Party module. The user must be able to spawn the processes separately because nginx is not able to automatically spawn them [9]. nginx does not support normal CGI applications [10], which is actually a security benefit.

Memcached

Nginx has built-in support to communicate directly with memcached. This is particularly useful for super-fast delivery of pages that are cached in memcached by a background process or a web application [11].

Lighttpd supports similar features through its mod_cml module.

X-Sendfile

X-Sendfile is a feature that allows scripts or web applications to send files on the filesystem that are restricted by the web server (nginx / lighttpd) by having the script send a special header.

Lighttpd accomplishes this by using the X-Sendfile header with an absolute file path. nginx has a more restricted feature using the X-Accel-Redirect header that allows for relative file paths from a predefined location [12].

Separated error logging per virtual server

Lighttpd's author intentionally refused to support this feature, despite user requests [13].
Nginx supports separate error logging per virtual server [14].

Architecture

Both Lighttpd and nignx are asynchronous servers.

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. [...] 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).

Lighttpd runs as a single process with a single thread and non-blocking I/O.

nginx works as one master process but delegates its work unto worker processes.

Support

Lighttpd has been popular in the United States for longer than nginx and is known to have many modules.

The greatest hindrance for a wide adoption of nginx was a lack of English support. There has been much improvement in this point, however, and there is now an English Wiki providing good documentation of nginx's features, albeit suffering from bad English grammar and lack of structure and coverage.

Bug tracking

Lighttpd has a full-blown bug tracking system powered by Redmine.
nginx has a poor man's bug tracking system in the form of a MoinMoin wiki page, which as of 2009-01-05, lists only one bug, dating from 2007-11-11.

IRC support

Both Lighttpd and nginx have IRC channels on the freenode.net server (#lighttpd and #nginx), but the nginx channel is very quiet, with long delays between responses to user questions [15].

Popularity

As of 2008-June, nginx hosts about 25% more domains than lighttpd, according to the June 2008 Netcraft survey.

Links

Pro nginx

Personal tools