Almost anyone who has used a computer for very long learns about bloat. Fromoperating systems to applications, one thing is sure: the new version willtake up more drive space than the last. And there are no guarantees thatthe new version will be faster. In fact, the more bloated andfeature-ridden a software package becomes, the more cumbersome and sluggishit is likely to become. Therefore when speed is critical, as it is on the Web,sometimes a smaller, less-complex program is more desirable. So it is with web servers.
Almost anyone who has used a computer for very long learns about bloat. From operating systems to applications, one thing is sure: the new version will take up more drive space than the last. And there are no guarantees that the new version will be faster. In fact, the more bloated and feature-ridden a software package becomes, the more cumbersome and sluggish it is likely to become. "Feeping creaturism." (That's "creeping featurism" for those of you without your glasses.)
I'm not saying that new features are all bad. Hey, I use Apache, and I've watched it grow from the first collection of patches ("a patchy server" == "Apache server") to NCSA's server into the amazing feature rich open source giant it is today. The giant does many things well, and I'm glad of it. There is an elegance, however, to code that's small, quick, fast, and light on its feet. And there's often an accompanying speed increase.
That is where thttpd comes into the picture. Jef Poskanzer(a.k.a. ACME Laboratories) wrote thttpd and shares it with the rest of us at his web site at www.acme.com. It is a full-fledged web server, written in C. And it's small, fast, simple, portable, and secure.
The tiny/turbo/throttling httpd (thttpd) server's elegant simplicity packs an astounding number of features in a very small box, just over 7,000 lines of code. Features include:
Full CGI 1.1 compliance and compatibility
Very tight CGI restrictions for the security conscious
Built-in ability to operate the server in a chroot() directory, another nice security feature
Portable: it reportedly works under Linux, SunOS 4, Solaris 2, BSD/OS, OSF, and FreeBSD. (I know it works on FreeBSD since that's my own OS of choice).
Basic authentication support (.htpasswd)
Throttling: the ability to limit the byte rate(s) for a URL or a group of URLs, bandwidth control in the hands of the server administrator
Name-based and IP-based virtual hosting support
MMAP caching of often-requested files
Did I mention, it is FAST!?!?
That's a whole lot of wallop for such a tiny httpd server.
While thttpd does not replace Apache, it does fill a niche. Ngenuity runs Apache and thttpd side-by-side serving up high-traffic web sites. Apache servers up the dynamic content, and thttpd quickly fetches the small, static files, like image files. This combination works extremely well.
Randy Cosby of ngenuity stated:
"We started hitting some bottlenecks on our Apache server with a number of modules installed. We tweaked, tuned and added memory, but were still running into occasional errors spawning CGI's. We realized we were wasting significant resources spawning new Apache processes just to serve up graphics. Our load averages have dropped significantly since we moved our graphics to thttpd. Apache is faster, and we haven't run into a single spawn error since. We probably just added a year onto the useful life of our server. An excellent investment!"