Lighttpd vs nginx

From WikiVS, the open comparison website

Jump to: navigation, search
Lighttpd Nginx
Lighttpd
VS
Nginx
http://www.lighttpd.net http://wiki.codemongers.com/Main

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]. Fast, efficient serving of static content [4]. It is acclaimed for having low memory usage and is recommended for sites running on a VPS.

There are also some who claim that Lighttpd suffers from memory leaks.

"It seems that Lighttpd might perform best in a more fragmented file system (smaller files)." [5]

Features

Both Lighttpd and nginx [6] supports modules that enhances functionality. They try to balance the number of built-in modules for performance reasons.

FastCGI

Lighttpd has support for CGI and FastCGI via module. [7] Not only can it retrieve pages from CGI/FastCGI processes, it can automatically spawn them. [8]

nginx has module support for CGI/FastCGI via builtin module [9], SCGI [10] and WSGI [11] via 3rd Party module . The user must be able to spawn the processes separately because nginx is not able to automatically spawn them. [12]

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

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

Nginx Wiki , Nginx Wiki

Lighttpd runs as 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 is a lack of English support. There has been much improvement in this point, however, and there is now an English Wiki providing virtually complete documentation of nginx's features.

Links

Pro nginx

Personal tools