Cache

Introduction

The Base Agent relies heavily on the file cache. All files being downloaded are downloaded directly to the cache and there it is being registered by MD5 checksum and file date. The MD5 checksum is generated by the client itself during file download. Upon completion, the checksum along with the LastModifiedDate of the file is saved in the cache dictionary. This MD5 checksum is the ID of the file when a new file job is created. When a new download file job is created, the BaseAgent requests the Front-end Server for the MD5 checksum of the file in question. This checksum is then used to ask if the file cache has a file with that particular checksum. I there is an entry in the cache dictionary, the cache will check if the file is physically present in the cache folder. If yes, the LastModifiedDate of the file is then compared to that of the cache dictionary. When/if matched, the file cache will respond 'yes' to the file request from the file job. This is done to ensure that all files are valid throughout the CapaInstaller installation.

Along with the MD5 checksum and the LastModifiedDate of the file, the number of times that that particular file has been requested is up-counted. The number of uses is later used when the file cache maintenance routine will prune the files in the cache in order to comply with the file cache settings. More seldom-used files are removed fist.

When the file cache module is trying to comply with settings, it has two properties to watch out for that are also a part of the Agent configuration from the Management Server to which the client computer is linked.

The CacheMaxSize is the upper limit for the files located in the cache, and the CacheMinFree is the amount of free space that can not be violated. Both values can be fixed (GB) or variable (%). For variable values, an exact amount is calculated on the basis of the disk size on which the file cache is located. So 30 % on a 955 GB disk is 286 GB.


Firstly the size of the cache folder (4.6 GB) is shown. Given that the maximum folder size is 100 GB, there is still room inside the cache for 95 GB of files.

Secondly, with 318 GB of free space and a configuration that dictates that 30% (286 GB) should be kept free, there is only room for an additional 32 GB of files in the cache.

The smaller of the two numbers (95 GB and 32 GB) means that the 'Space available in total' is 32 GB. When that limit is exceeded, the cache maintenance routine will prune old (seldom used files) in order to comply with the limits. In this particular case, the Base Agent is only capable of deleting 4.6 GB to meet the requirements.

Testing

The example above is set up artificially, only in order to demonstrate the mechanism of the file cache maintenance. A 30 % free disk configuration would probably never happen, but more likely a 5 % or 10 % figure might.


The file count of the cache is shown along with the MD5 speed. This speed is the amount of data that the CPU is capable of processing when calculating MD5 checksums on average. The Hit rate is the number of times that the file cache was able to fulfill a file request from a file job looking for a file.