Memory Cache Configuration

The default chunk size for a memory cache is 8 kilobytes (2-to-the-13th-power). There is no predefined default for the number of chunks in a memory cache, and, as mentioned previously, the number of dcache entries equals the number of chunks.

If the -blocks option is used alone, it overrides the default cache size in the CacheInfo file. The Cache Manager divides this value by the default chunk size of 8 kilobytes to calculate the number of chunks and dcache entries. The following example sets the cache size to 5 megabytes (5120 kilobytes); as a result, the number of chunks is set to 640 (5120 divided by 8):

dfsd -memcache -blocks 5120

If the -chunksize option is used alone, it overrides the default of 8 kilobytes (2-to-the-13th-power). Provide an integer between 13 and 18 to be used as an exponent of 2. For example, a value of 15 sets the chunk size to 32 kilobytes (2-to-the-15th-power= 32,768). A value less than 13 or greater than 18 returns the chunk size to the default (as does a value of 13). The following example sets the chunk size to 16 kilobytes (2-to-the-14th-power); if the total cache size is 4 megabytes (2-to-the-12th-power kilobytes), the resulting number of chunks is 256:

dfsd -memcache -chunksize 14

If the -blocks and -chunksize options are used together, they override the defaults for the cache size and the chunk size. The Cache Manager divides the cache size by the chunk size to calculate the number of chunks and dcache entries. The following example sets the cache size to 8 megabytes (8192 kilobytes) and the chunk size to 16 kilobytes (2-to-the-14th-power), resulting in 512 chunks:

dfsd -memcache -blocks 8192 -chunksize 14

When configuring a memory cache, the following options explicitly set the number of chunks and dcache entries. They also set the cache size indirectly and should not be used; use -blocks, -chunksize, or both, and allow the Cache Manager to determine the number of chunks and dcache entries itself.

· The -dcache option alone. The Cache Manager multiplies this value by the default chunk size (8 kilobytes) to derive a total cache size, overriding the value in the CacheInfo file.

· A combination of -dcache and -chunksize options. The Cache Manager sets the specified values and multiplies them together to obtain a total cache size, again overriding the value in the CacheInfo file.

Do not use the following options when configuring a memory cache:

· The -files option alone. This option sets the number of chunks for a disk cache and is thus ignored for a memory cache.

· The -blocks and -dcache options together. If you combine these options, the Cache Manager may choose one of the values to ignore, or the command may fail.

(See Part 2 of this guide and reference for complete information about these options and the use of the dfsd command in general.)