Global config section

The global section defines properties of the running server that don't apply to a single virtual server. The following tags are relevant to the global section.

Global config entities

cache max=NUM

Sets the maximum number of cached responses that will be held in memory. Each cached responses holds a minimal amount of memory. More importantly, each cached response holds an open file descriptor to the file with real content and an mmap()ed region of that content. phhttpd will start pruning the cache when it notices either of these two resources coming under pressure, but has no way to easily deduce that its running low on memory. The administrator may set this value to set an upper bound on the number of responses to keep in memory.

control file=PATH mode=MODE

This specifies the file that will be used to talk with phhttpd_ctl. phhttpd will attempt to remove any file existing at the specified path as it starts up. It will also force the permissions on the file to MODE after it is created. Be Very Careful with these.

maxfds num=NUM

This specifies the maximum number file descriptors that phhttpd will try and allow for when it starts up. Some operating systems may require explicit requests for descriptors beyond a default limit. Remember that all network connections and open files count against this limit, so aim for the number of clients connected at a time, plus the number of content and log files that will be held open. Multiply the resulting sum by some small percentage, for good measure.

mime file=PATH

This specifies the file that contains the mapping of file extensions to MIME types. It should be of the form:
text/sgml                       sgml sgm
video/mpeg                      mpeg mpg mpe

sendfile

Enabling this option tells phhttpd to use sendfile() rather than write()ing from an mmap()ed region. Avoiding calling mmap() will shorten the amount of time it takes to build cached responses.

threads num=NUM

Tells phhttpd the number of worker threads to startup at run time. This will not change for the duration of the program. Generally speaking, one wants a few more threads than CPUs to make full use of a machine.

tunnel file=PATH mode=MODE

This specifies the file that will be used to talk with the backing web server. As with the control file, phhttpd will attempt to remove any file existing at the specified path as it starts up. It will also force the permissions on the file to MODE after it is created. Again, be Very Careful with these.