3. Limits and Design Philosophy
There are many issues that become more difficult to resolve in a single
tasking web server than in the normal forking model. Here is a partial
list -- there are probably others that haven't been encountered yet.
3.1 Limits
- Slow file systems
The file systems being served should be much faster than the
network connection to the HTTP requests, or performance will suffer.
For instance, if a document is served from a CD-ROM, the whole server
(including all other currently incomplete data transfers) will stall
while the CD-ROM spins up. This is a consequence of the fact that Boa
mmap()'s each file being served, and lets the kernel read and cache
pages as best it knows how. When the files come from a local disk
(the faster the better), this is no problem, and in fact delivers
nearly ideal performance under heavy load. Avoid serving documents
from NFS and CD-ROM unless you have even slower inbound net
connections (e.g., POTS SLIP).
- DNS lookups
Writing a nonblocking gethostbyaddr is a difficult and not very
enjoyable task. Paul Phillips experimented with several methods,
including a separate logging process, before removing hostname
lookups entirely. There is a companion program with Boa
`util/resolver.pl' that will postprocess the logfiles and
replace IP addresses with hostnames, which is much faster no matter
what sort of server you run.
- Identd lookups
Same difficulties as hostname lookups; not included.
Boa provides a REMOTE_PORT environment variable, in addition
to REMOTE_ADDR, so that a CGI program can do its own ident.
See the end of examples/cgi-test.cgi.
- Password file lookups via NIS
If users are allowed to serve HTML from their home directories,
password file lookups can potentially block the process. To lessen
the impact, each user's home directory is cached by Boa so it need
only be looked up once.
- Running out of file descriptors
Since a file descriptor is needed for every ongoing connection
(two for non-nph CGIs, directories, and automatic gunzipping of files),
it is possible though highly improbable to run out of file
descriptors. The symptoms of this conditions may vary with
your particular unix variant, but you will probably see log
entries giving an error message for accept.
Try to build your kernel to give an adequate number for
your usage - GNU/Linux provides 256 out of the box, more than
enough for most people.
3.2 Differences between Boa and other web servers
In the pursuit of speed and simplicity, some aspects of Boa differ
from the popular web servers. In no particular order:
- REMOTE_HOST environment variable not set for CGI programs
The REMOTE_HOST environment variable is not set for CGI programs,
for reasons already described. This is easily worked around because the
IP address is provided in the REMOTE_HOST variable, so (if the CGI
program actually cares) gethostbyaddr or a variant can be used.
- There are no server side includes (SSI) in Boa
We don't like them, and they are too slow to parse. We will consider
more efficient alternatives.
- There are no access control features
Boa will follow symbolic links, and serve any file that it can
read. The expectation is that you will configure Boa to run as user
"nobody", and only files configured world readable will come
out.
- No chroot option
There is no option to run chrooted. If anybody wants this, and is
willing to try out experimental code, contact the maintainers.
3.3 Unexpected Behavior
- SIGHUP handling
Like any good server, Boa traps SIGHUP and rereads `boa.conf'.
However, under normal circumstances, it has already given away
permissions, so many items listed in `boa.conf' can not take effect.
No attempt is made to change uid, gid, log files, or server port.
All other configuration changes should take place smoothly.
- Relative URL handling
Not all browsers handle relative URLs correctly. Boa will not
cover up for this browser bug, and will typically report 404 Not Found
for URL's containing odd combinations of "../" 's.
Note: As of version 0.95.0 (unreleased) the URL parser has been
rewritten and *does* correctly handle relative URLs.
This document was generated
by releng on April, 7 2005
using texi2html