From: Daniel Clark Date: Thu, 7 Sep 2006 23:54:00 +0000 (+0000) Subject: none X-Git-Url: https://git.openafs.org/?p=openafs-wiki.git;a=commitdiff_plain;h=3ac3f4c2e6a5c6c61e07cd74c9f557b01f3696b3 none --- diff --git a/AFSLore/ConfiguringtheCache.mdwn b/AFSLore/ConfiguringtheCache.mdwn index 900fa60..31c909a 100644 --- a/AFSLore/ConfiguringtheCache.mdwn +++ b/AFSLore/ConfiguringtheCache.mdwn @@ -1,26 +1,22 @@ -The Cache Manager uses a cache on the local disk or in machine memory to store local copies of files fetched from file server machines. As the afsd program initializes the Cache Manager, it sets basic cache configuration parameters according to definitions in the local /usr/vice/etc/cacheinfo file. The file has three fields: - -1. The first field names the local directory on which to mount the AFS filespace. The conventional location is the /afs directory. +# Configuring the Cache -1. The second field defines the local disk directory to use for the disk cache. The conventional location is the /usr/vice/cache directory, but you can specify an alternate directory if another partition has more space available. There must always be a value in this field, but the Cache Manager ignores it if the machine uses a memory cache. +The Cache Manager uses a cache on the local disk or in machine memory to store local copies of files fetched from file server machines. As the afsd program initializes the Cache Manager, it sets basic cache configuration parameters according to definitions in the local /usr/vice/etc/cacheinfo file. The file has three fields: -1. The third field specifies the number of kilobyte (1024 byte) blocks to allocate for the cache. +1. The first field names the local directory on which to mount the AFS filespace. The conventional location is the /afs directory. %BR% %BR% +2. The second field defines the local disk directory to use for the disk cache. The conventional location is the /usr/vice/cache directory, but you can specify an alternate directory if another partition has more space available. There must always be a value in this field, but the Cache Manager ignores it if the machine uses a memory cache. %BR% %BR% +3. The third field specifies the number of kilobyte (1024 byte) blocks to allocate for the cache. The values you define must meet the following requirements. -\* On a machine using a disk cache, the Cache Manager expects always to be able to use the amount of space specified in the third field. Failure to meet this requirement can cause serious problems, some of which can be repaired only by rebooting. You must prevent non-AFS processes from filling up the cache partition. The simplest way is to devote a partition to the cache exclusively. - -\* The amount of space available in memory or on the partition housing the disk cache directory imposes an absolute limit on cache size. +- On a machine using a disk cache, the Cache Manager expects always to be able to use the amount of space specified in the third field. Failure to meet this requirement can cause serious problems, some of which can be repaired only by rebooting. You must prevent non-AFS processes from filling up the cache partition. The simplest way is to devote a partition to the cache exclusively. -\* The maximum supported cache size can vary in each AFS release; see the IBM AFS Release Notes for the current version. +- The amount of space available in memory or on the partition housing the disk cache directory imposes an absolute limit on cache size. -\* For a disk cache, you cannot specify a value in the third field that exceeds 95% of the space available on the partition mounted at the directory named in the second field. If you violate this restriction, the afsd program exits without starting the Cache Manager and prints an appropriate message on the standard output stream. A value of 90% is more appropriate on most machines. Some operating systems (such as AIX) do not automatically reserve some space to prevent the partition from filling completely; for them, a smaller value (say, 80% to 85% of the space available) is more appropriate. +- The maximum supported cache size can vary in each AFS release; see the IBM AFS Release Notes for the current version. -\* For a memory cache, you must leave enough memory for other processes and applications to run. If you try to allocate more memory than is actually available, the afsd program exits without initializing the Cache Manager and produces the following message on the standard output stream. +- For a disk cache, you cannot specify a value in the third field that exceeds 95% of the space available on the partition mounted at the directory named in the second field. If you violate this restriction, the afsd program exits without starting the Cache Manager and prints an appropriate message on the standard output stream. A value of 90% is more appropriate on most machines. Some operating systems (such as AIX) do not automatically reserve some space to prevent the partition from filling completely; for them, a smaller value (say, 80% to 85% of the space available) is more appropriate. - afsd: memCache allocation failure at number KB - -The number value is how many kilobytes were allocated just before the failure, and so indicates the approximate amount of memory available. +- For a memory cache, you must leave enough memory for other processes and applications to run. If you try to allocate more memory than is actually available, the afsd program exits without initializing the Cache Manager and produces the following message on the standard output stream. afsd: memCache allocation failure at number KB The number value is how many kilobytes were allocated just before the failure, and so indicates the approximate amount of memory available. Within these hard limits, the factors that determine appropriate cache size include the number of users working on the machine, the size of the files with which they work, and (for a memory cache) the number of processes that run on the machine. The higher the demand from these factors, the larger the cache needs to be to maintain good performance. @@ -34,17 +30,8 @@ Note: Not all file system types that an operating system supports are necessaril To configure the disk cache, perform the following procedures: -1. Create the local directory to use for caching. The following instruction shows the conventional location, /usr/vice/cache. If you are devoting a partition exclusively to caching, as recommended, you must also configure it, make a file system on it, and mount it at the directory created in this step. - - # mkdir /usr/vice/cache - -1. Create the cacheinfo file to define the configuration parameters discussed previously. The following instruction shows the standard mount location, /afs, and the standard cache location, /usr/vice/cache. - - # echo "/afs:/usr/vice/cache:#blocks" > /usr/vice/etc/cacheinfo - -The following example defines the disk cache size as 50,000 KB: - - # echo "/afs:/usr/vice/cache:50000" > /usr/vice/etc/cacheinfo +1. Create the local directory to use for caching. The following instruction shows the conventional location, /usr/vice/cache. If you are devoting a partition exclusively to caching, as recommended, you must also configure it, make a file system on it, and mount it at the directory created in this step. # mkdir /usr/vice/cache +2. Create the cacheinfo file to define the configuration parameters discussed previously. The following instruction shows the standard mount location, /afs, and the standard cache location, /usr/vice/cache. # echo "/afs:/usr/vice/cache:#blocks" > /usr/vice/etc/cacheinfo The following example defines the disk cache size as 50,000 KB: # echo "/afs:/usr/vice/cache:50000" > /usr/vice/etc/cacheinfo ## Configuring a Memory Cache @@ -55,3 +42,7 @@ To configure a memory cache, create the cacheinfo file to define the configurati The following example allocates 25,000 KB of memory for the cache. # echo "/afs:/usr/vice/cache:25000" > /usr/vice/etc/cacheinfo + +## Cache Parameter Recommendations + +- [Tuning the OpenAFS UNIX client cache manager](http://www.pmw.org/afsbpw06/talks/mcgarr-afsbpw06-tweaking-cm.pdf) - From the AFS & Kerberos Best Practices Workshop, Ann Arbor, Michigan, June 12-16, 2006