HGserver Configuration File

On startup, hgserver will attempt to load configuration information from one of several files.  On unix systems, /etc/hgserver.cf and $HOME/.hgserver.cf will be examined.  On Windows, the files %SystemRoot%\hgserver.cf and any hgserver.cf in the same directory as hgserver.exe will be read.  Use command line option "-f" to specify a different configuration file.    Settings will be honored in the following order of increasing precedence: built-in defaults, %SystemRoot% or /etc config file, home or exe config file, with the command line options overriding all.

Each line consists of at most 127 characters of plain text.  Lines beginning with a hash, space, or tab are ignored.  All other lines have one of the following formats:

<variable>=<value>
<variable> <value>

The second form ignores any leading white space in <value>.  Variable names are not case sensitive.  See the enclosed hgserver.cf file for an example.  Following is a list of variables which may be set.  Many of these have corresponding command line options, described briefly in the previous section.  Not all variables may be available for all platforms or license types.

Aggression <-2 to 2>
[-a]  Advise MTP/IP as to how aggressive it should be in fully utilizing the network path.  Positive values may increase performance at the expense of third-party traffic.  Negative values may reduce path latency and allow better performance for other traffic, at the cost of reducing performance.

Debug <0 to 6>
[-d]  Turn on diagnostic output.  Levels above 1 will produce copious output and degrade performance.

Expire <seconds>
[-e]  Sets how long hgserver should wait without hearing from a client before it gives up and cancels a stalled transaction.  Longer values may be useful on highly unreliable networks.

HGServerConfigVersion 1
Verifies the format of the configuration file.  hgserver will not run if this variable is not set to a compatible version number.

Host <address:port>
[-h]  Sets the default HTTP server to be used if the client does not specify.

Interface <IP Address>
[-n]  Bind hgserver to the given local network interface.

LogFile <path name>
[-l]  Append diagnostic output to the named file path.

Latency <rtt>[:<rate>]
Advise MTP/IP of operation on a path with a high latency (over 500ms).  The first number is the minimum round trip time of the path, in milliseconds.  The second number, if present, advises the expected speed of the link (in kilobytes per second) and activates pipelining mode, which may result in faster throughput files on high-delay links.  This value is different from MaxRate, and should be a conservative (low) estimate.

MaxRate <kilobytes per second>
[-k]  Set a limit on how fast each transaction can go.

MaxRTT <milliseconds>
Request that the path latency for each transaction be limited to the given amount of time.  This option may severely degrade performance.

MaxTran <simultaneous connections>
[-c]  Limit the number of simultaneous transactions.

MinRTT <milliseconds>
Advise MTP/IP as to the minimum latency of your network uplink.  See Latency above.

Port <UDP Port Number>
[-p]  Change the UDP port number used to listen for requests.  Use this option if there is a port conflict or you wish to take advantage of another UDP port that is already open in your firewall.

Site <address>[/bits] <Aggression> <MaxRate> <Expire> <MaxRTT> <Latency>
Configure performance for individual peers.  Address must be a name, IP address, or subnet.  For subnets, use an address followed by a slash and the number of mask bits.  Remaining fields are white space separated and correspond to the named variables.  A value of 0 implies that the default should be used.  You may have multiple Site lines, one for each address.  hgserver will attempt to resolve DNS names when it first runs and will refresh them periodically.  If a name cannot be resolved at startup, hgserver will not run.

StreamSize <kilobytes>
[-b]  Set the network buffer size for each HTTP transaction.  The default is 8192 kilobytes, which is appropriate for links between 10 and 100 megabits per second.  Smaller values may be used on slower or very reliable links.