Lingerd: An overlooked program for Open Source Webmasters

93
– By Brian Aker
Sometimes Open Source software can be a great secret despite all of the recent news coverage. The secret isn’t that Open Source exists, but many useful Open Source software projects get little or no recognition. One such application is lingerd, written by Roger Espel Llima of iAgora.com.

Lingerd is a daemon process that sits in front of your Apache processes to handle socket IO. What it does is free up your webserver to handle your application layer instead of dealing with clients that tie up your Apache children. This is a huge gain for sites using PHP, mod_perl or one of the Java engines. Having expensive Apache processes waiting around for clients to close sockets is a waste of resources.

Installing lingerd is easy. To quote Uriah Welcome of SourceForge.net, it’s “stupid simple to set up.” Compiling lingerd is a quick “make” and “make install.”

To have Apache use lingerd you need to patch your Apache source tree. The patch is very simple and works without fault in the basic Apache server. If you have a copy of Apache that has EAPI installed, you will need to resolve one line of code (and this really should be a trivial fix for lingerd in the future). Once you recompile Apache it will look for lingerd during startup. If it is not found it will work in its default manner. If lingerd is available it will make use of it.

Lingerd’s benefits are impressive. When the software was installed on Slashdot.org servers, the immediate result was that all of the front end servers that had 40 Apache children running dropped to two. On SourceForge.net lingerd not only dropped child process from around 100 to 10, but decreased database usage because there were fewer Apache processes talking to the database. According to Uriah, “Memory usage on the [SourceForge.net] database server went from 2GB to 500MB.” Brad Fitzpatrick of LiveJournal has reported success with lingerd, too. If you add up SourceForge, Slashdot, and LiveJournal, it’s obvious that lingerd is more than ready for large, prime-time Web sites to use even though its author calls the current version 0.9.4, not 1.0.

Will lingerd work well in all cases? In situations such as image servers, where you are dealing with static content, the effect should be less noticable (and with image servers you should perhaps be looking at a different Web server, such as Boa). But if you are running a large site with dynamic content you should certainly take a look at using it.

Category:

  • News