33.2 Examining and Adjusting MVFS Cache Size

Client hosts that use dynamic views may be able to benefit from MVFS cache tuning. Use the getcache command to print information about your MVFS cache. For example:

cleartool getcache -mvfs
Mnodes: (active/max) 1791/8192 (21.863%)
Mnode freelist: 1701/1800 (94.500%)
Cltxt freelist: 737/1800 (40.944%)

DNC: Files: 848/1600 (53.000%)
Directories: 185/400 (46.250%)
ENOENT: 827/1600 (51.688%)

RPC handles: 4/10 (40.000%)

NOTE: The statistics presented above are in the form current-number-on-list/list-capacity and (percentage-of-list-capacity).

Attribute cache miss summary (for tuning suggestions, see the
documentation for administering ClearCase):
Attribute cache total misses: 49609 (100.00%)
Close-to-open (view pvt) misses: 18964 ( 38.23%)
Generation (parallel build) misses: 1179 ( 2.38%)
Cache timeout misses: 234 ( 0.47%)
Cache fill (new file) misses: 0 ( 0.00%)
Event time (vob/view mod) misses: 29232 ( 58.92%)

You may want to change ClearCase MVFS cache sizes to improve performance, if your host performs builds that involve a large (greater than 400) number of files.

Remember, the size of physical memory is the key factor, but caching changes may help.

To resize the MVFS caches, do one of the following:

NOTE: On some UNIX computers, you must recompile the kernel after changing mvfs_largeinit. For details, see the Platform-Specific Guide in online help.

Increasing mvfs_largeinit adds about 500 KB to the size of kernel (200 KB nonpageable, 300 KB pageable) memory for each increment of the mvfs_largeinit value or scaling factor. Enlarging the MVFS caches reduces the amount of memory available to applications but provides better performance when the working set of objects in a build or command exceeds the default cache allocations. Increase the value gradually and check the cache utilization with cleartool getcache -mvfs. If you change your MVFS configuration, also consider reconfiguring each view that is used to access ClearCase data on that host, increasing its view_server cache size. See Reconfiguring a View.

Table 12 describes each tunable caching parameter with recommendations for setting its size. Also shown is the relationship among the fields in the getcache output, the setcache options, and the names of the caching parameters.

Table 12 MVFS Cache Information


getcache Output Field Name

Description

Make Adjustments with:

setcache Option

Caching Parameter (UNIX) Control Panel Value (Windows)

Mnodes


An mnode is a data structure used in the MVFS to keep track of a file or directory. The number of mnodes grows dynamically.


(N/A)


mvfs_mnmax on UNIX, (N/A on Windows)


Mnode freelist


Maximum number of mnodes to keep on the VOB free list

Mnodes on the VOB free list were used (open or had statistics fetched from them) recently but are currently idle. By keeping more mnodes on a free list, the time needed to reopen the associated file is reduced.


-vobfree


mvfs_vobfreemax (UNIX)

Control Panel value (Windows)


(N/A)


Minimum number of mnodes to keep on the VOB free list. When the number of mnodes on the VOB free list reaches the value specified by mvfs_vobfreemax, the number will be reduced to the value specified by mvfs_vobfreemin


(N/A)


mvfs_vobfreemin (UNIX)

Control Panel value (Windows)


Cltxt freelist


Mnodes on the free list may also contain pointers to underlying storage pool file objects. The cleartext free list is the collection of these file objects. Keeping these object pointers cached in the mnode speeds the reopening of an MVFS-resident file, but consumes additional memory resources on the client machine. (On a Windows computer, these resources include open file descriptors, for example, on a LAN Manager connection if the storage is on a remote computer.)


-cvpfree


mvfs_cvpfreemax

Mnodes to keep for cleartext free list (Do not change this value except to fix error #2009 in the event log: server could not expand a table because it reached the maximum size.)


DNC Files


These caches perform name translations to files, directories, or nonexistent names. If a file name is looked up but not in the cache, the MVFS must perform a remote procedure call (RPC) to the view_server to translate the name to a file or directory (or receive an error that the name is not found). When a name is found in the cache, the MVFS saves time by avoiding the RPC. The capacity of each of these categories can be adjusted independently.


-regdnc


mvfs_dncregmax

Maximum number of entries for files


DNC Directories


-dirdnc


mvfs_dncdirmax

Maximum number of entries for directories


DNC ENOENT


-noentdnc


mvfs_dncnoentmax

Maximum number of entries for non-existent names


RPC handles


One RPC handle is used for each RPC in progress from the MVFS to a view_server. If the cache is 100% full and you perform large builds with many simultaneously active processes, you may want to increase this cache size to reduce the time taken to perform an RPC. After an RPC handle is added to this cache, it stays on the list until ClearCase is stopped on that host. If no RPC handles are available in the cache, a new one is created on demand. If the cache is not full, the new RPC handle is returned to the cache when the RPC completes. Otherwise, it is destroyed when the RPC completes.


-rpchandles


mvfs_client_cache_sizeRPC handles


Real-Time Updating of MVFS Cache Sizes

To perform real-time updating of the MVFS cache sizes, use cleartool setcache -mvfs, which modifies cache sizes without requiring you to shut down and restart your computer. Real-time updating is useful for testing different configurations until you find the one that is best for you.

The entries in the sample output show the corresponding setcache options that can be used to make adjustments to these caches.

cleartool getcache -mvfs
Mnodes: (active/max) 1791/8192 (21.863%) (grows automatically)
Mnode freelist: 1701/1800 (94.500%) (adjust with -vobfree option)
Cltxt freelist: 737/1800 (40.944%) (adjust with -cvpfree option)

DNC: Files: 848/1600 (53.000%) (adjust with -regdnc option)
Directories: 185/400 (46.250%) (adjust with -dirdnc option)
ENOENT: 827/1600 (51.688%) (adjust with -noentdnc option)

RPC handles: 4/10 (40.000%) (adjust with -rpchandles option)
.
.
.

You probably also need to use the mvfsstat and mvfstime commands to determine the effectiveness of your cache before manipulating its size. A full cache is not necessarily ineffective if its hit rate is high enough. We recommend maintaining a hit rate of 85% or better.

NOTE: setcache can sometimes fail with a "Device busy" error. Such errors are usually transient and indicate that some other process is also trying to use the MVFS.

Adjusting the MVFS Memory Initialization Factor

You can specify how much memory the MVFS uses for various caches by changing the MVFS scaling factor.

The MVFS scaling factor is set automatically, as shown in Table 13, based on the amount of physical memory installed in the host computer.

Table 13 How Memory Size Affects the MVFS Scaling Factor


Memory Size

<24MB

24MB-256MB

256MB-1GB

>1GB

MVFS Scaling Factor


0


1


2


size/512MB +1


If you wish, you can manually override the automatic setting.

Changing the value of mvfs_largeinit or the Scaling Factor scales all of the MVFS cache sizes proportionally as shown in Table 14.

Table 14 How the MVFS Scaling Factor or mvfs_largeinit Affects Individual MVFS Cache Sizes


MVFS Cache Name

scaling factor or mvfs_largeinit
= 0

scaling factor or mvfs_largeinit
= 1

scaling factor or mvfs_largeinit
= 2

scaling factor or mvfs_largeinit
> 0

DNC File Cache


800 bytes


1600 bytes


2400 bytes


800(N+1) bytes


DNC Directory Cache


200 bytes


400 bytes


600 bytes


200(N+1) bytes


DNC ENOENT Cache


800


1600


2400


800(N+1)


Cleartext File Cache (UNIX)


900


1800


2700


900(N+1)


Cleartext File Cache (Windows)


900


1800


1800


1800


RPC Handle Cache


5


10


15


5(N+1)


Mnode Freelist Cache


900


1800


2700


900(N+1)


Mnode Cache


4096


8192


1288


4096(N+1),N<4;

2048(N+7),N>4


Setting Individual Caching Parameters on UNIX

Platform-specific instructions for changing caching parameters on all supported UNIX systems are provided in the Platform-Specific Guide in online help.

The following list identifies all significant caching components and provides the default values as loaded at system startup. You can bypass this level of detail by choosing the mvfs_largeinit option as described in Adjusting the MVFS Memory Initialization Factor.

For the individual cache sizes associated with particular values of mvfs_largeinit, see Adjusting the MVFS Memory Initialization Factor.

Setting Individual Cache Sizes on Windows

Use the ClearCase Control Panel to modify individual cache sizes. On the MVFS Performance tab, select the Override check box for a particular value. Enter a new value for the parameter. When you have finished modifying fields, click OK.

Each mnode in the mnode freelist cache uses about 400 bytes. Each entry in the DNC files, directories, and ENOENT caches uses about 100 bytes.

After changing cache sizes, you must shut down and restart your computer to make your changes take effect.

Minimizing Attribute Cache Misses

The sections that follow this sample output describe each cache-miss category and the ways to reduce the miss count.

cleartool getcache -mvfs
.
.
.
Attribute cache miss summary (for tuning suggestions, see the
documentation for administering ClearCase):
Attribute cache total misses: 49609 (100.00%)
Close-to-open (view pvt) misses: 18964 ( 38.23%)
Generation (parallel build) misses: 1179 ( 2.38%)
Cache timeout misses: 234 ( 0.47%)
Cache fill (new file) misses: 0 ( 0.00%)
Event time (vob/view mod) misses: 29232 ( 58.92%)

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 rechecks with the view_server when a view-private file is reopened to refresh its cached attributes in case the file was modified by another MVFS client.

This behavior can be disabled on a per-computer (not a per-view) basis. If you are absolutely sure that no other client on the network is updating view-private files in any views you are using from an MVFS client, you may want to disable this behavior to reduce these cache misses.

Use mvfscache to change this setting.

Generation Misses

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

Cache Timeout Misses

Cache timeout misses occur when a file's attributes have not been verified recently. The MVFS periodically rechecks a file's attributes to ensure that it does not cache stale copies of the attributes.

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 within 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:

If you consider changing these values, be aware that a longer timeout means that this client may not notice other clients' updates to the VOB or view for longer periods.

To change these values, specify a mount option for the VOB in one of the following ways:

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 may be too small for your working set. Consider increasing the number of mnodes on the free list by changing the mvfs_vobfreemax parameter as described in Setting Individual Caching Parameters on UNIX and Setting Individual Cache Sizes on Windows.

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 "foo" mapped to a particular file object, but the attribute cache on that object needs to be refreshed because of a timeout or a parallel-build-induced generation miss).

These misses cannot be completely eliminated, but as with Cache Timeout Misses they can be reduced by adjusting minimum/maximum cache lifetimes.