Overview of Cache Manager Customization
| Chapter 10. Administering Client Machines and the Cache Manager |

## Overview of Cache Manager Customization

An AFS client machine's kernel includes a set of modifications, commonly referred to as the Cache Manager, that enable access to AFS files and directories and communications with AFS server processes. It is common to speak of the Cache Manager as a process or program, and in regular usage it appears to function like one. When configuring it, though, it is helpful to keep in mind that this usage is not strictly accurate.

The Cache Manager mainly fetches files on behalf of application programs running on the machine. When an application requests an AFS file, the Cache Manager contacts the Volume Location (VL) Server to obtain a list of the file server machines that house the volume containing the file. The Cache Manager then translates the application program's system call requests into remote procedure calls (RPCs) to the File Server running on the appropriate machine. When the File Server delivers the file, the Cache Manager stores it in a local cache before delivering it to the application program.

The File Server delivers a data structure called a callback along with the file. (To be precise, it delivers a callback for each file fetched from a read/write volume, and a single callback for all data fetched from a read-only volume.) A valid callback indicates that the Cache Manager's cached copy of a file matches the central copy maintained by the File Server. If an application on another AFS client machine changes the central copy, the File Server breaks the callback, and the Cache Manager must retrieve the new version when an application program on its machine next requests data from the file. As long as the callback is unbroken, however, the Cache Manager can continue to provide the cached version of the file to applications on its machine, which eliminates unnecessary network traffic.

The indicated sections of this chapter explain how to configure and customize the following Cache Manager features. All but the first (choosing disk or memory cache) are optional, because AFS sets suitable defaults for them.

- disk or memory cache. The AFS Cache Manager can use machine memory for caching instead of space on the local disk. Deciding which to use is the most basic configuration decision you must make. See Determining the Cache Type, Size, and Location.

- cache size. Cache size probably has the most direct influence on client machine performance. It determines how often the Cache Manager must contact the File Server across the network or discard cached data to make room for newly requested files, both of which affect how quickly the Cache Manager delivers files to users. See Determining the Cache Type, Size, and Location.

- cache location. For a disk cache, you can alter the conventional cache directory location (/usr/vice/cache) to take advantage of greater space availability on other disks on the machine. A larger cache can result in faster file delivery. See Determining the Cache Type, Size, and Location.

- chunk size and number. The afsd program, which initializes the Cache Manager, allows you to control the size and number of chunks into which a cache is divided, plus related parameters. Setting these parameters is optional, because there are reasonable defaults, but it provides precise control. The AFS distribution includes configuration scripts that set Cache Manager parameters to values that are reasonable for different configurations and usage patterns. See Setting Other Cache Parameters with the afsd program.

- knowledge of database server machines. Enable access to a cell's AFS filespace and other services by listing the cell's database server machines in the /usr/vice/etc/CellServDB file on the local disk. See Maintaining Knowledge of Database Server Machines.

- setuid privilege. You can control whether the Cache Manager allows programs from a cell to execute with setuid permission. See Determining if a Client Can Run Setuid Programs.

- cell membership. Each client belongs to a one cell defined by the local /usr/vice/etc/ThisCell file. Cell membership determines the default cell in which the machine's users are authenticated and in which AFS commands run. See Setting a Client Machine's Cell Membership.

- cached file version. AFS's system of callbacks normally guarantees that the Cache Manager has the most current versions of files and directories possible. Nevertheless, you can force the Cache Manager to fetch the most current version of a file from the File Server if you suspect that the cache contains an outdated version. See Forcing the Update of Cached Data.

- File Server and Volume Location Server preferences. The Cache Manager sets numerical preference ranks for the interfaces on file server machines and Volume Server (VL) machines. The ranks determine which interface the Cache Manager first attempts to use when fetching data from a volume or from the Volume Location Database (VLDB). The Cache Manager sets default ranks as it initializes, basing them on its network proximity to each interface, but you can modify the preference ranks if you wish. See Maintaining Server Preference Ranks.

- interfaces registered with the File Server. If the Cache Manager is multihomed (has multiple interface addresses), you can control which of them it registers for File Servers to use when they initiate RPCs to the client machine. See Managing Multihomed Client Machines.

- display of information messages. By default, the Cache Manager sends basic error and informational messages to the client machine's console and to command shells. You can disable the messaging. See Controlling the Display of Warning and Informational Messages.

- system type. The Cache Manager records the local machine's AFS system type in kernel memory, and substitutes the value for the @sys variable in pathnames. See Displaying and Setting the System Type Name.

- delayed writes. By default, the Cache Manager writes all data to the File Server immediately and synchronously when an application program closes a file. You can enable asynchronous writes, either for an individual file, or all files that the Cache Manager handles, and set how much data remains to be written when the Cache Manager returns control to the closing application. See Enabling Asynchronous Writes.

You must make all configuration changes on the client machine itself (at the console or over a direct connection such as a telnet connection). You cannot configure the Cache Manager remotely. You must be logged in as the local superuser root to issue some commands, whereas others require no privilege. All files mentioned in this chapter must actually reside on the local disk of each AFS client machine (they cannot, for example, be symbolic links to files in AFS).

Chapter 10. Administering Client Machines and the Cache Manager |  | Configuration and Cache-Related Files on the Local Disk