thttpd Web Server
Home Up thttpd Web Server Cherokee web CRON and SSMTP Samba Velleman K8055 Perl Module GD in Perl Slugos-native

 

thttpd Web Server

The thttpd web server is nothing like Cherokee

Whereas Cherokee provides a lot of configuration options that allow various parts of a site to be located in different places a thttpd server is mainly intended to serve one directory tree, except for some special handling of directories with "~" symbols in.

thttpd is also built very differently to Cherokee. It's a single thread process built out of non-blocking code so one instance of the program handles all inbound requests, as opposed to the more usual practice of coding a server to handle one request at a time and forking multiple instances to handle multiple requests. The single threaded approach has several advantages and disadvantages:

  1. Thttpd does not suffer the overhead of forking processes to handle incoming connections.
  2. On some systems Thttpd may be subject to a bottleneck where the operating system puts incoming connections in a small queue. To counter this Thttpd places a high priority on accepting connections. Openslug is based on Debian linux, which appears to allow a server to set its own queue size.
  3. The Thttpd process can die entirely. On uNSLUng firmware this could be triggered by having a share with a name that conflicts with a directory name in the www directory. One solution used on web servers is a short (two line) respawn script. The script simply runs Thttpd as a foreground task and then loops back to the start.