/*----------------------------------------------------------------------------- Copyright (C) 2000, 2001, 2002, Alan Kennington. You may distribute this software under the terms of Alan Kennington's modified Artistic Licence, as specified in the accompanying LICENCE file. -----------------------------------------------------------------------------*/This software package is open and free. Please read the LICENCE file for precise details. |
DISCLAIMER. The author of this software disclaims any express or implied guarantee of the fitness of this software for any purpose. In no event shall the author of this software be held liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. |
the trace display
In the bwshare-trace display, if there's an exclamation mark `!' to the left of
a reverse DNS translation, that means that the double-reverse lookup failed.
|
garbage disposal
The Apache module `bwshare' has a `garbage disposal' algorithm which is really
an information compaction or weeding algorithm.
When `garbage disposal' occurs, the least important information is cleared from
the table until a predefined tide-mark is reached.
The garbage disposal occurs in the function bws_garbage_disposal().
The high-water marks for the remote host table are called hwm_hard and hwm_soft.
Next, the number of occupied hsot records n_host_records is calculated.
Next, all host records are evaluated for their `interest' or importance.
typedef struct host_sort_t { uint16 host_index; /* Array index of this host record. */ uint16 keep; /* Indication of whether to keep it. */ int32 value; /* How valuable the record is to keep. */ };The field `host_index' is the offset of the remote host record in the array of host records. The field `keep' is an integer which indicates how important the host record is. The field `value' is a secondary measure of importance. Records are sort primarily in increasing order of the field `keep', and secondarily by increasing order of the field `value'. The host record evaluation formula is the dodgiest aspect of the garbage disposal algorithm. The evaluation algorithm makes use of the following host record information
This is because you can't delete a host record which is not even present. The `keep' value is 0 if and only if the TX1 and TX2 debts are currently zero, the peak TX1 and TX2 debts do not exceed the specified bounds for these debts, the total numbers of requests and downloaded files do not exceed the specified warning level, and the idle time is greater than a specified maximum idle time for display of records. For the default colours in the monitor screen, this means that keep=0 if and only if there are no yellow or red boxes for the host, the last access is not recent, and the host's debt is currently zero. The host records which are evaluated to have keep=0 are very uninteresting indeed, and are therefore deleted before all others.
All host records with any current debt at all are given keep=4.
The value of `value' is the sum of various debt, idle-time and other factors. Now the host records are all sorted according into increasing order of importance, primarily by `keep' and secondarily by `value'.
Then host records are successively deleted from the least to the most important
until enough have been deleted.
|