Cache Tool

CacheTool is a command line tool for interacting with the Traffic Server cache. CacheTool started as a side project to not only explore the Traffic Server cache but as a test bed for various other technologies of interest to me, some of which are not really cache related. The goal was for the eventual release these other technologies to open source as they matured. My view was the ancillary software would be of better quality if validated in actual use first.

  • TS.Scalar: a template for creating quantized integral types. This has been contributed to open source.
  • StringView: read only view of string data. This has been contributed to open source.
  • Better command line parsing for action oriented tools like CacheTool and traffic_ctl.
  • File system path and file handling class.
  • New data structures for the cache, as part of a larger scale redesign.
  • Improved stripe allocation algorithms.

In addition to being a test bed, Cache Tool was intended to do useful work. An early feature, stripe re-allocation, was built to get around a bug in Traffic Server where a disk that was replaced would not actually be used by the cache. This was originally a request from the Oath operations team but it was sufficiently useful to another member of the community that I was persuaded to make CacheTool public before it was even alpha quality.

Some of the intended features of CacheTool are

  • Fix stripe allocation for unused disks.
  • List stripe data for a cache.
  • Clear / reset cache disks independently.
  • Provide cache directory analysis, as is done by passing --command check to traffic_server now, but with sufficiently low resource requirements it can be run on live system.
  • Cache directory diagnostics.
  • Cache scanning
    • Scan to purge.
    • Statistical analysis.
  • Cache repartitioning.
    • Store additional information about cache configuration.
      • More efficient and reliable examination.
      • Required to repartition, if values are always computed there is a chicken and egg problem.
    • Update stripes to shift storage between directory and content (change effect average object size).
    • Maintain backwards compatibility and some forward compatibility. In particular it must be possible to run 8.0 on a box and revert to 7.X without clearing the cache.

Usage

CacheTool has an action oriented interface with commands and subcommands (and possibly subsubcommands, etc.), modeled on traffic_ctl.

list

List information about the cache.

stripes
List per stripe information.
alloc
Allocate cache space to stripes.