Minimizing attribute cache misses

The MVFS caches attributes of file and directory objects to avoid having to look them up in the VOB. A full attribute cache is not necessarily ineffective if its hit rate is high enough. A good goal would be to maintain a hit rate of 85% or better. The sections that follow describe each cache-miss category and describe ways to reduce the miss count.

Attribute cache total misses

Total misses is the sum of all the misses entries. This total is reduced by reducing the other categories of misses entries described below.

Close-to-open misses

Close-to-open misses occur when an open view-private file is reopened by another process. The MVFS checks with the view_server when a view-private file is reopened and refreshes cached file attributes if the file was modified by another MVFS client.

This behavior can be disabled on a per-host (not a per-view) basis. If you are certain that a host will not access view-private files in views on any other host, you can disable close-to-open consistency checking on that host to reduce these cache misses.

Use setcache –mvfs –ncto to disable close-to-open consistency checking. Use setcache -mvfs –cto to re-enable it. (Use the –persistent option if you want the change to persist across reboots.)

Generation misses

Generation misses occur during a parallel build. If you are doing parallel builds, you cannot avoid these misses.

Cache time-out misses

Cache time-out misses occur when a file’s attributes have not been verified recently. The MVFS periodically revalidates these attributes to ensure that it does not cache stale data.

These misses cannot be completely eliminated. However, the time-out period for the attributes may be adjusted. The cache timeout varies, depending on how recently a file or directory was modified; the more recently the file was modified, the shorter the time-out period. The value for this initial time-out period is constrained to lie between the minimum and maximum attribute-cache lifetimes as specified at VOB mount time through the acregmin/acregmax (for regular files) and acdirmin/acdirmax (for directories) parameters. These are the default values:
  • acregmin: 3 seconds
  • acregmax: 60 seconds
  • acdirmin: 30 seconds
  • acdirmax: 60 seconds
To change these values, specify a mount option for the VOB in one of the following ways:
  • At mount time. For example:

    cleartool mount –options acregmin=30 vob-tag

    You must be a privileged user to do this.
  • In the registry (either at VOB creation with mkvob or later by using mktag). For example:

    cleartool mktag –vob –tag vob-tag –replace –options mount-options ...

Note: The time-out values specified in these mount options affect the view’s metadata latency (the delay before changes to VOB metadata become visible in a dynamic view other than the one in which the changes were made). Longer time-out values improve performance at the expense of greater latency. Shorter time-out values decrease latency, but also have an impact on view performance because the caches must be refreshed more frequently.

Cache fill misses

Cache fill misses occur when a file’s attributes are not in the cache. If the percentage of these is high (above 20%), your cache might be too small for your working set. Consider increasing the number of mnodes on the free list by running setcache –mvfs –vobfreemax.

Event time misses

Event time misses occur when a cached name-to-object translation requires revalidation of the attributes on the resulting object (for example, the name cache has a file name mapped to a particular file object, but the attribute cache on that object needs to be refreshed because of a time-out or a parallel-build-induced generation miss). These misses cannot be completely eliminated, but as with cache time-out misses, they can be reduced by adjusting minimum or maximum cache lifetimes.