I have been using Lighttpd for almost a year and Nginx for a month on my servers. I know that they were created to be massively scalable, solving the C10k problem . However their asynchronised-IO model and small memory foot-print also make them suitable as alternative HTTP servers for memory-limited VPS. Alternative = Anything but the current defacto Apache .
I will be writing more about Lighttpd and Nginx later during the year, but will try to use this post to draw some comparison between Nginx , The new darling of these light-weight web servers, and Lighttpd , Many Web 2.0 developers' all time favourite.
I have been running Lighttpd (pronounced "lighty") on my home servers and development boxes since the beginning of 2006. It is a great replacement for Apache if you have the whole box to yourself, ie you don't need to worry about supporting .htaccess files that your users might use. Currently this website is hosted on lighttpd-1.4.13 on a Gentoo VPS.
Light weight. Clean restart of 1.4.13 takes no more than 2Mb RSS on this 64bit VPS. It binds the port, drops the privilege and that's it! A single process does all the tricks even when you have hundreds of concurrent connections. No more pre-fork MPM with mis-configured MaxClient that sends you to swap hell.
Speed. Very fast static file serving. Very fast FastCGI serving. Very fast proxy serving.
Modules, and lots of them . Good comprehensive documentation as well. It even has SCGI for your Quixote apps.
Mod_magnet. Wanna a scripting engine right inside your web server? Mod_magnet integrates Lua into lighttpd, so your World of Warcraft scripting skillz can be put into better use.
Stability (or lack of according to the RoR folks). I had quite a lot of issues using Lighttpd as proxy + HTTPS front-end for our Python stuff, but the same app runs fine with just lighttpd + proxy without HTTPS.
Mod_rewrite (or again, lack of it). Built-in rewriting engine sucks, and porting Apache mod_rewrite rules over can be non-trivial sometimes. Update: Here's an article I have written on Drupal clean URL on Nginx and Lighttpd , Which looks at the URL rewrite options of these two web servers.
Memory leak. The RSS of my lighty process grows by about 1.5Mb per day, but then I don't have lots of traffic (less than 50k requests a day). At the end I just need to restart it once a week. Many people have far worse memory leaking issues I heard.
I have been running Nginx (pronounced "engine X") on my development box and two of my VPS's since December 2006. It is Russian, fast and very configurable. I am currently using 0.5.5 for my sites, but don ' t be deceived by its version number - it is very stable.
Light weight. It is not as light weight as lighttpd when it clean-starts. At least two processes are needed - one master process running as root that binds to the port, and one or more worker processes that handle the actual requests. Around 7Mb RSS together on my 64bit VPS (and only 4.5Mb on 32bit VPS). Still beats Apache hands down.
Fast. Some benchmarks have shown that Nginx has a slight edge over Lighttpd, but so far I haven't been able to notice any. Again, much faster than Apache over static file serving or proxying, especially when you turn up the value of keep alive (more than 1 minute for example).
Better Rewrite Module. A much better rewrite module than Lighttpd that supports complex conditions. Porting mod_rewrite rules from Apache is actually now feasible without touching the apps themselves.
Stable and not leaking. Been running Nginx on a production site doing PHP-FastCGI, and have no issue what so ever.
Lack of community. Where can I find help regarding Nginx? There's only IRC as far as I know. And while the lead developer writes beautiful code, all documentation were initially in Russian which was a big stumbling block before the English docs came along.
No CGI support. Oh well, maybe I am the only one who still hacks small CGI scripts. Apparently Nginx does not spawn CGI or FastCGI processes, which means you need to either (1) convert it into external-spawn FastCGI, or (2 ) proxy to another web server that does CGI.
No simple virtual host support. Lighttpd has mod_simple_vhost and mod_evhost to let you quickly deploy lots of name-based virtual hosts. You can somehow do the same with using $server_name in root and a wild-card in server_name, but it's still not as clean as lighttpd. At the end you will find Nginx configuration files much more verbose if you run lots of small sites off a single web server.
No X-sendfile support. I found Lighttpd's X-sendfile support very useful when my scripts need to send back large files, and was disappointed to find out that Nginx does not have it. X-Accel-Redirect is different as it requires extra configuration on web server, which makes your web-app less portable.
I don't think I am a suitable judge to say which one is better, as (1) I have only been running Nginx for a month, and (2) my level of traffic does not really stress test these high-performing web servers . At the moment I think I like Nginx better purely because it does not leak, and its rewrite module that enables me to run many off-the-shelf open source PHP apps with clean URL.
Again, I might change my mind in 3 months time when I find out more warts about Nginx. We will see.
Concurrent connections by looking Nginx, we can be more clear to know the site load. Nginx complicated view there are two ways (This is so because I only know of two), one is through the web interface is through the command, web view than the command to s
Nginx limit the number of concurrent ip, that is the same ip limit the number of simultaneous connections the server. 1, add limit_zone This variable can only use http. vi / usr / local / nginx / conf / nginx.conf limit_zone one $ remote_addr 10m; 2,
How to view the Linux system apache concurrent connections View that the number of httpd processes (ie, prefork mode Apache can handle concurrent requests): Linux shell command as follows: ps-ef | grep httpd | wc-l Check the Apache number of concurre
1 Server 1.1 In the Tomcat world, a Server represents the whole container. Tomcat provides a default implementation of the Server Interface. , and this is rarely Customized by users. 1.2 in tomcat's world, a server on behalf of the entire container. T
Popular speaking, Web server, send (serves) Page so that browsers can view, however, the application server provides the client application can call (call) Way (methods). The point, You can say :Web Server dedicated to handling HTTP requests (request), Ho
In general, the first piece of Ethernet card used in the Linux name for eth0, as an example to illustrate. 1, temporarily modify the MAC (MAC set to recover after restart) First, network cards must be closed, otherwise it will report the system busy, can
resin file does not update resin as a web server to update the static js file, or when the browser displays the contents of the old reward: 5 Published :2010 -04-22 Asked by: tangjun1984 (Junior Programmer) < My question is described as follows: w