
Thousands of range requests for a very large object in the traffic server cache
are likely to increase system load averages due to I/O wait as objects are stored
on a single stripe or disk drive.

This plugin allows you to remap individual range requests so that they are stored
as individual objects in the ATS cache when subsequent range requests are likely
to use the same range.  This spreads range requests over multiple stripes thereby
reducing I/O wait and system load averages.

This plugin reads the range request header byte range value and then creates a
new cache key url using the original request url with the range value appended
to it.  The range header is removed where appropriate from the requests and the
origin server response code is changed from a 206 to a 200 to insure that the
object is written to cache using the new cache key url.  The response code sent
to the client will be changed back to a 206 and all requests to the origin server
will contain the range header so that the correct response is received.

Configuration:

    Add @plugin=cache_range_requests.so to your remap.config rules.

    Or for a global plugin where all range requests are processed,
    Add cache_range_requests.so to the plugin.config

Parent Selection Mode (consisent-hash only):

    default: Parent selection is based solely on the hash of a URL Path
             In this mode, all partial content of a URL is requested from the same
             upstream parent cache listed in parent.config

    cache_key_url: Parent selection is based on the full cache_key_url which
                   includes information about the partial content range.
                   In this mode, all requests (include partial content) will use
                   consistent hashing method for parent selection.

    To enable cache_key_url parent select mode, the following param must be set:

    Global Plugin (plugin.config):

      cache_range_requests.so ps_mode:cache_key_url

    Remap Plugin (remap.config):

      <from-url> <to-url> @plugin=cache_range_requests.so @pparam=ps_mode:cache_key_url
