Chapter 40 Using The CacheFS File System (Tasks)
This chapter describes how to set up and maintain CacheFSTM file systems.
This is a list of task maps in this chapter.
For information on troubleshooting CacheFS errors, see Troubleshooting cachefspack Errors.
High-Level View of Using the CacheFS File System (Task Map)
Use this task map to identify all the tasks for using CacheFS file systems.
Each task in this map points to a series of additional tasks such as creating
and mounting the CacheFS file systems, and packing and maintaining the cache.
Overview of the CacheFS File System
The CacheFS file system is a general purpose caching mechanism that
improves NFS server performance and scalability by reducing server and network
load. Designed as a layered file system, the CacheFS file system provides
the ability to cache one file system on another. In an NFS environment, the
CacheFS file system increases the client per server ratio, reduces server
and network loads, and improves performance for clients on slow links, such
as Point-to-Point Protocol (PPP).
How a CacheFS File System Works
You create a CacheFS file system on a client system so that file systems
you cache can be accessed by the client locally instead of across the network.
The following figure shows the relationship of the components that are involved
in using CacheFS file system.
Figure 40–1 How a CacheFS File System Works
The back file system is the file system that you
specify to be mounted in the cache, which can be either NFS or HSFS (High
Sierra File System). When the user attempts to access files that are part
of the back file system, those files are placed in the cache. The front file system is the file system that is mounted in the cache
and is accessed from the local mount point. The front file system type must
be UFS.
To the user, the initial request to access a file in a CacheFS file
system might seem slow, but subsequent uses of the same file are faster.
CacheFS File System Structure and Behavior
Each cache has a set of parameters that determines the cache structure
and how it behaves. The parameters are set to default values which are listed
in the following table. The default values specify that the entire front file
system is used for caching, which is the recommended method of caching file
systems.
Table 40–1 CacheFS File System Parameters and Their Default Values
|
CacheFS File System
Parameter
|
Default
Value
|
Definition
|
|
maxblocks
|
90%
|
Sets the maximum number of blocks that a CacheFS file system
is allowed to claim within the front file system.
|
|
minblocks
|
0%
|
Sets the minimum number of blocks that a CacheFS file system
is allowed to claim within the front file system.
|
|
threshblocks
|
85%
|
Sets the number of blocks that must be available in the
front file system before a CacheFS file system can claim more than the blocks
specified by minblocks.
|
|
maxfiles
|
90%
|
Sets the maximum number of available inodes (number of
files) that a CacheFS file system is allowed to claim within the front file
system.
|
|
minfiles
|
0%
|
Sets the minimum number of available inodes that a CacheFS
file system is allowed to claim within the front file system.
|
|
threshfiles
|
85%
|
Sets the number of inodes that must be available in the
front file system before a CacheFS file system can claim more than the files
specified in minfiles.
|
Typically, you should not change any of these parameter values. They
are set to default values to achieve optimal cache behavior. However, you
might want to modify the maxblocks and maxfiles values if you have some room in the front file system that is not
used by the cache, and you want to use it for some other file system. You
do so by using the cfsadmin command. For example:
$ cfsadmin -o maxblocks=60
|
Creating and Mounting a CacheFS File System (Task Map)
Use the procedures in this table to create and mount a CacheFS file
system.
How to Create the Cache
-
Become superuser on the client system.
-
Create the cache.
# cfsadmin -c /cache-directory
|
cache-directory indicates the name of the
directory where the cache resides.
For more information, see cfsadmin(1M).
Note –
After you have created the cache, do not perform any operations
within the cache directory itself. Doing so could cause conflicts within the
CacheFS software.
Example—Creating the Cache
The following example shows how to create a cache in the /local/mycache directory by using the default cache parameter values.
# mkdir /local
# cfsadmin -c /local/mycache
|
Mounting a File System in the Cache
You specify a file system to be mounted in the cache so that users can
locally access files in that file system. The files do not actually get placed
in the cache until the user accesses the files.
The following table describes three ways to mount a CacheFS file system.
|
Mount Type for CacheFS File System
|
Frequency of CacheFS Mount Type
|
|
Using the mount command
|
Every time the system reboots in order to access the same file
system.
|
|
Editing the /etc/vfstab file
|
Only once. The /etc/vfstab file remains
unchanged after the system reboots.
|
|
Using AutoFS
|
Only once. AutoFS
maps remain unchanged after the system reboots.
|
Choose the method of mounting file systems that best suits your environment.
You can mount only file systems that are shared. For information on
sharing file systems, see share(1M).
Note –
The caching of the root (/) and /usr file systems is not supported in a CacheFS file system.
How to Mount a CacheFS File System (mount)
-
Become superuser on the client system.
-
Create the mount point, if necessary.
You can create the mount point from anywhere but it must be a UFS file
system. The CacheFS options used with the mount command,
as shown in the next step, determine that the mount point you create is cached
in the cache directory you specify.
-
Mount a file system in the cache.
# mount -F cachefs -o backfstype=fstype,cachedir=/cache-directory[,options]
/back-filesystem /mount-point
|
|
fstype
|
Indicates the file system type of the
back file system, which can be either NFS or HSFS.
|
|
/cache-directory
|
Indicates
the name of the UFS directory where the cache resides. This name is the same
name you specified when you created the cache in How to Create the Cache.
|
|
options
|
Specifies other mount options that
you can include when you mount a file system in a cache. For a list of CacheFS mount options, see mount_cachefs(1M).
|
|
/back-filesystem
|
Specifies
the mount point of the back file system to cache. If the back file system
is an NFS file system, you must specify the host name of the server from which
you are mounting the file system and the name of the file system to cache,
separated by a colon. For example, merlin: /data/abc.
|
|
/mount-point
|
Indicates the directory where the file
system is mounted.
|
-
Verify that the cache you created was actually mounted.
# cachefsstat /mount-point
|
The /mount-point is the CacheFS file system
that you created.
For example:
# cachefsstat /docs
/docs
cache hit rate: 100% (0 hits, 0 misses)
consistency checks: 1 (1 pass, 0 fail)
modifies: 0
garbage collection: 0
|
If the file system was not mounted in the cache, you see an error message
similar to the following:
# cachefsstat /mount-point
cachefsstat: mount-point: not a cachefs mountpoint
|
For more information about the cachefsstat command,
see Collecting CacheFS Statistics.
Examples—Mounting a CacheFS File System (mount)
The following example shows how to mount the NFS file system merlin:/docs as a CacheFS file system named /docs
in the cache named /local/mycache.
# mkdir /docs
# mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache merlin:/docs /docs
|
The following example shows how to make a Solaris 9 SPARC CD (HSFS file
system) available as a CacheFS file system named /cfssrc.
Because you cannot write to the CD, the ro argument is
specified to make the CacheFS file system read-only. This example assumes
that vold is not running.
# mount -F hsfs -o ro /dev/dsk/c0t6d0s0 /sol9
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst,
backpath=/sol9 /dev/dsk/c0t6d0s0 /cfssrc
# ls /cfssrc
Copyright Solaris_9
|
The following example shows how to mount a Solaris 9 SPARC CD as a CacheFS
file system with vold running.
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst,
backpath=/cdrom/sol_9_sparc/s0 /vol/dev/dsk/c0t2d0/sol_9_sparc/s0 /cfssrc
|
The following example shows how to mount a CD as a CacheFS file system
with vold running.
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst,
backpath=/cdrom/epson /vol/dev/dsk/c0t2d0/epson /drvrs
|
The following example uses the demandconst option
to specify consistency checking on demand for the NFS CacheFS file system /docs, whose back file system is merlin:/docs.
For more information, see Consistency Checking of a CacheFS File System.
# mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache,demandconst merlin:/docs /docs
|
How to Mount a CacheFS File System (/etc/vfstab)
-
Become superuser on the client system.
-
Using an editor, specify the file systems to be mounted in the /etc/vfstab file.
See the example that follows.
For more information on the /etc/vfstab file, see Field Descriptions for the /etc/vfstab File.
-
Mount the CacheFS file system.
Or, reboot the system.
Example—Mounting a CacheFS File System (/etc/vfstab)
The following example shows the /etc/vfstab entry
for the /data/abc directory from remote system starbug that is mounted in the cached directory, /opt/cache.
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
starbug:/data/abc /local/abc /opt/cache cachefs 7 yes local-access,bg,
nosuid,demandconst,backfstype=nfs,cachedir=/opt/cache
|
How to Mount a CacheFS File System (AutoFS)
You can mount a file system in a cache with AutoFS by specifying the -fstype=cachefs mount option in your automount map. Note that the
CacheFS mount options, for example, backfstype and cachedir, are also specified in the automount map. For details on
automount maps, see automount(1M).
-
Become superuser on the client system.
-
Using an editor, add the following line to the auto_direct map:
/mount-point -fstype=cachefs,cachedir=/directory,backfstype=nfs
server:/file-system
|
-
Using an editor, add the following line to the auto_master map:
The /- entry is a pointer to check the auto_direct map.
-
Reboot the system.
-
Verify that the entry was made correctly by changing to the file system
you mounted in the cache, and then list the contents, as follows:
For more information about AutoFS and how to edit the maps, refer to “Task
Overview for Autofs Administration” in System Administration
Guide: Resource Management and Network Services.
Example—Mounting a CacheFS File System (AutoFS)
The following auto_direct entry automatically mounts
the CacheFS file system in the /docs directory.
/docs -fstype=cachefs,cachedir=/local/mycache,backfstype=nfs merlin:/docs
|
Maintaining a CacheFS File System (Task Map)
After a CacheFS file system is set up, it requires little maintenance.
Use the optional procedures in this table if you need to perform maintenance
tasks on your CacheFS file systems.
Maintaining a CacheFS File System
This section describes how to maintain a CacheFS file system.
If you are using the /etc/vfstab file to mount
file systems, you modify the cache by editing the file system options in the /etc/vfstab file. If you are using AutoFS, you modify the cache
by editing the file system options in the AutoFS maps.
Modifying a CacheFS File System
When you modify a file system in the cache, you need to delete the cache
and then re-create it. You might also need to reboot your machine in single-user
mode, depending on how your file systems are shared and accessed.
In the following example, the cache is deleted, re-created, and then
mounted again with the demandconst option specified for
the /docs file system.
# shutdown -g30 -y
.
.
.
Type Cntrl-d to proceed with normal startup,
(or give root password for system maintenance):
# enter password:
.
.
.
Here is where you might be prompted to run fsck on the
file system where the cache is located.
# fsck /local
# mount /local
# cfsadmin -d all /local/mycache
# cfsadmin -c /local/mycache
# init 6
.
.
.
console login:
password:
# mount -F cachefs -o backfstype=nfs,cachedir=/local/cache1,demandconst
merlin:/docs /docs
#
|
How to Display Information About a CacheFS File System
-
Become superuser on the client system.
-
Display information about all file systems cached under a specified
cache.
# cfsadmin -l /cache-directory
|
/cache-directory is the name of the directory
where the cache resides.
Example—Displaying Information About CacheFS File Systems
The following example shows information about the /local/mycache cache directory. In this example, the /docs
file system is cached in /local/mycache. The last line
displays the name of the CacheFS file system.
# cfsadmin -l /local/mycache
cfsadmin: list cache FS information
maxblocks 90%
minblocks 0%
threshblocks 85%
maxfiles 90%
minfiles 0%
threshfiles 85%
maxfilesize 3MB
merlin:_docs:_docs
#
|
Consistency Checking of a CacheFS File System
To ensure that the cached directories and files remain current, the
CacheFS software periodically checks the consistency of files stored in the
cache. To check consistency, the CacheFS software compares the current modification
time to the previous modification time. If the modification times are different,
all data and attributes for the directory or file are purged from the cache.
And, new data and attributes are retrieved from the back file system.
Consistency Checking on Demand
Consistency checks can be performed only when you explicitly request
checks for file systems that are mounted with -o demandconst
option. If you mount a file system in a cache with this option, then use the cfsadmin command with the -s option to request a
consistency check. By default, consistency checking is performed file by file
as the files are accessed. If no files are accessed, no checks are performed.
Using the -o demandconst option avoids the situation where
the network is flooded with consistency checks.
For more information, see mount_cachefs(1M).
How to Specify Cache Consistency Checking on Demand
-
Become superuser on the client system.
-
Mount the file system in the cache and specify cache consistency checking.
# mount -F cachefs -o backfstype=nfs,cachedir=/directory,demandconst
server:/file-system /mount-point
|
-
Initiate consistency checking on a specific CacheFS file system.
# cfsadmin -s /mount-point
|
How to Delete a CacheFS File System
-
Become superuser on the client system.
-
Unmount the CacheFS file system.
/mount-point specifies the CacheFS file system
that you want to delete.
-
Determine the name of the CacheFS file system (cache ID).
# cfsadmin -l /cache-directory
cfsadmin: list cache FS information
maxblocks 90%
minblocks 0%
threshblocks 85%
maxfiles 90%
minfiles 0%
threshfiles 85%
maxfilesize 3MB
cache-ID
#
|
-
Delete the CacheFS file system from the specified cache.
# cfsadmin -d cache-ID /cache-directory
|
|
cache-ID
|
Indicates the name of the CacheFS file
system, which is the last line of the cfsadmin -l output.
For more information, see How to Display Information About a CacheFS File System. You can delete
all the CacheFS file systems in a particular cache by specifying all for cache-ID.
|
|
/cache-directory
|
Specifies
the directory where the cache resides.
|
-
Verify that the file system has been deleted.
The cache ID of the file system you just deleted should be missing from
the cfsadmin -l output.
# cfsadmin -l /cache-directory
cfsadmin: list cache FS information
maxblocks 90%
minblocks 0%
threshblocks 85%
maxfiles 90%
minfiles 0%
threshfiles 85%
maxfilesize 3MB
#
|
For more information about the fields that are specified in the command
output, refer to cfsadmin(1M).
-
Update the resource counts for the cache by running the fsck -F cachefs command.
For more information, see How to Check the Integrity of a CacheFS File System.
Examples—Deleting a CacheFS File System
The following example shows how to delete the file systems from the
cache.
# umount /cfssrc
# cfsadmin -l /cfssrc
# cfsadmin -d _dev_dsk_c0t6d0s0:_cfssrc
# cfsadmin -l
|
How to Check the Integrity of a CacheFS File System
Use the fsck command to check the integrity of CacheFS
file systems. The CacheFS version of the fsck command automatically
corrects problems without requiring user interaction. You should not need
to run the fsck command manually for CacheFS file systems
because the fsck command is run automatically at boot time
or when the file system is mounted. If you want to manually check the integrity,
you can use the following procedure.
For more information, see fsck_cachefs(1M).
-
Become superuser on the client system.
-
Check the file systems in the specified cache.
# fsck -F cachefs [-m -o noclean] /cache-directory
|
|
-m
|
Causes the fsck
command to check a CacheFS file system without making any repairs.
|
|
-o noclean
|
Forces a check on the CacheFS file
systems only. Does not make any repairs.
|
|
/cache-directory
|
Indicates
the name of the directory where the cache resides.
|
Example—Checking the Integrity of CacheFS File Systems
The following example shows how to check the file systems cached in
the /local/mycache cache.
# fsck -F cachefs /local/mycache
#
|
Packing a Cached File System (Task Map)
The following task map describes the procedures that are associated
with packing a CacheFS file system. All of these procedures are optional.
Packing a CacheFS File System
For general use, the CacheFS software operates automatically after it
is set up, without requiring any action from the user. Files are cached on
a most recently used basis. With the packing feature,
you can take a more active role in managing your cache by ensuring that certain
files or directories are always updated in the cache.
You can specify files and directories to be loaded in the cache with
the cachefspack command. This command ensures that current
copies of these files are available in the cache.
The packing list contains the names of specific
files and directories. The packing list can also contain other packing lists.
This feature saves you having to specify individual files and directories
when you have many items to pack in your cache.
You can print out a brief help summary of all the cachefspack options by using the -h option as follows:
$ cachefspack -h
Must select 1 and only 1 of the following 5 options
-d Display selected filenames
-i Display selected filenames packing status
-p Pack selected filenames
-u Unpack selected filenames
-U Unpack all files in directory 'dir'
-f Specify input file containing rules
-h Print usage information
-r Interpret strings in LIST rules as regular expressions
-s Strip './' from the beginning of a pattern name
-v Verbose option
files - a list of filenames to be packed/unpacked
|
How to Pack Files in the Cache
Pack files in the cache by using the cachefspack
command.
$ cachefspack -p filename
|
|
-p
|
Specifies that you want the file or
files to be packed. This option is also the default.
|
|
filename
|
Specifies the name of the files or
directory you want packed in the cache. When you specify a directory, all
of its subdirectories are also packed. For more information, see cachefspack(1M).
|
Examples—Packing Files in the Cache
The following example shows the projects file being
packed in the cache.
$ cachefspack -p projects
|
The following example shows three files being packed in the cache.
$ cachefspack -p projects updates master_plan
|
The following example shows a directory being packed in the cache.
$ cachefspack -p /data/abc/bin
|
How to Display Packed Files Information
Display packed files information by using the cachefspack -i command.
$ cachefspack -i[v] filename
|
|
-i
|
Specifies that you want to view information
about your packed files.
|
|
-v
|
Is the verbose option.
|
|
cached-filename-or-directory
|
Specifies
the name of the file or directory for which to display information.
|
Example—Displaying Packed Files Information
The following example shows that the doc_file file
is successfully packed.
$ cachefspack -i doc_file
cachefspack: file doc_file marked packed YES, packed YES
|
In the following example, the /data/abc directory
contains the bin subdirectory. The bin
subdirectory has three files: big, medium,
and small. Although the big and small files are specified to be packed, they are not. The medium file is successfully packed.
$ cd /data/abc
$ cachefspack -i bin
.
.
.
cachefspack: file /bin/big marked packed YES, packed NO
cachefspack: file /bin/medium marked packed YES,
packed YES
cachefspack: file /bin/small marked packed YES,
packed NO
.
.
.
|
If you use the -iv options together, you get additional
information as to whether the file or directory specified has been flushed
from the cache. For example:
$ cd /data/bin
$ cachefspack -iv bin
.
.
.
cachefspack: file /bin/big marked packed YES, packed NO,
nocache YES
cachefspack: file /bin/medium marked packed YES,
packed YES, nocache NO
cachefspack: file /bin/small marked packed YES,
packed NO
nocache NO
.
.
.
|
The last line of the preceding example shows that the directory contents
have not been flushed from the cache.
Using Packing Lists
One feature of the cachefspack command is the ability
to create packing lists.
A packing list contains files or directories to be packed in the cache.
If a directory is in the packing list, all of its subdirectories and files
will also be packed.
This feature saves the time of having to specify each individual file
that you want packed in the cache.
How to Create a Packing List
To create a packing list, open a file by using vi
or the editor of your choice. The packing list file format uses the same format
as the filesync command. For more information, see filesync(1).
Two packing list features are the following:
-
You can identify files in the packing list as regular expressions
rather than literal file names so that you don't have to specify each individual
file name.
-
You can pack files from a shared directory by ensuring that
you pack only those files that you own.
For more information on using these features, see cachefspack(1M).
Example—Creating a Packing List
The following example shows the contents of a packing list file.
BASE /home/ignatz
LIST plans
LIST docs
IGNORE *.ps
|
-
The path identified with the BASE statement
is the directory where you have items you want to pack.
-
The two LIST statements identify specific
files within that directory to pack.
-
The IGNORE statement identifies the file
type of .ps, which you do not want to pack.
How to Pack Files in the Cache With a Packing List
Pack files in the packing list by using the cachefspack -f command, as follows:
$ cachefspack -f packing-list
|
|
-f
|
Specifies that you want to use a packing
list.
|
|
packing-list
|
Specifies the name of the packing list.
|
Example—Packing Files in the Cache With a Packing List
This example uses the list.pkg file as the packing
list for the cachefspack command.
$ cachefspack -f list.pkg
|
Unpacking Files or Packing Lists From the Cache
You might need to remove, or unpack, a file from the cache. Perhaps
you have some files or directories that have a higher priority than others,
so you need to unpack the less critical files. For example, you finished up
a project and have archived the files that are associated with that project.
You are now working on a new project, and therefore, a new set of files.
How to Unpack Files or Packing Lists From the Cache
Unpack files or packing lists from the cache by using the -u or -U option of the cachefspack
command.
$ cachefspack -u filename | -U cache-directory
|
|
-u
|
Specifies that you want the file or
files unpacked. You must specify a filename with this option.
|
|
filename
|
Specifies the name of the file or packing
list that you want unpacked in the cache.
|
|
-U
|
Specifies that you want to unpack all
files in the cache.
|
For more information about the cachefspack command,
see the man page.
Examples—Unpacking Files or Packing Lists From the Cache
The following example shows the file /data/abc/bin/big
being unpacked from the cache.
$ cachefspack -u /data/abc/bin/big
|
The following example shows several files being unpacked from the cache.
$ cd /data/abc/bin/big
$ cachefspack -u big small medium
|
The following example shows how to unpack a packing list, which is a
file that contains the path to a directory of files, as follows:
$ cachefspack -uf list.pkg
|
The following example uses the -U option to specify
that all files in a cache directory being unpacked.
$ cachefspack -U /local/mycache
|
You cannot unpack a cache that does not have at least one file system
mounted. With the -U option, if you specify a cache that does
not contain mounted file systems, you see output similar to the following:
$ cachefspack -U /local/mycache
cachefspack: Could not unpack cache /local/mycache, no mounted
filesystems in the cache.
|
Troubleshooting cachefspack Errors
You might see the following error messages when you use the cachefspack command.
cachefspack: pathname - can't open directory: permission denied
|
- Cause
-
You might not have the correct
permissions to access the file or directory.
- Action
-
Set the correct permissions.
cachefspack: pathname - can't open directory: no such file or
directory
|
- Cause
-
You might not have the correct
file or directory.
- Action
-
Check for a possible typo.
cachefspack: pathname - can't open directory: stale NFS file handle
|
- Cause
-
The file or directory might
have been moved or deleted from the server at the time you attempted to access
it.
- Action
-
Verify that the file or directory
on the server is still accessible.
cachefspack: pathname - can't open directory: interrupted system
call
|
- Cause
-
You might have inadvertently
pressed Control-C while issuing the command.
- Action
-
Reissue the command.
cachefspack: pathname - can't open directory: I/O error
|
- Cause
-
You might have a hardware
problem.
- Action
-
Check your hardware connections.
cachefspack: error opening dir
|
- Cause
-
You might not have the correct
file or directory. The path identified after the BASE command
in the file format could be a file and not a directory. The path specified
must be a directory.
- Action
-
Check for a possible typo.
Check the path identified after the BASE command in your
file format. Make sure the path identifies a directory, not a file.
cachefspack: unable to get shared objects
|
- Cause
-
The executable might be corrupt
or in a format that is not recognizable.
- Action
-
Replace the executable.
cachefspack: filename - can't pack file: permission denied
|
- Cause
-
You might not have the correct
permissions to access the file or directory.
- Action
-
Set the correct permissions.
cachefspack: filename - can't pack file: no such file or directory
|
- Cause
-
You might not have the correct
file or directory.
- Action
-
Check for a possible typo.
cachefspack: filename- can't pack file: stale NFS file handle
|
- Cause
-
The file or directory might
have been moved or deleted from the server at the time you attempted to access
it.
- Action
-
Verify that the file or directory
on the server is still accessible.
cachefspack: filename- can't pack file: interrupted system call
|
- Cause
-
You might have inadvertently
pressed Control-C while issuing the command.
- Action
-
Reissue the command.
cachefspack: filename- can't pack file: I/O error
|
- Cause
-
You might have a hardware
problem.
- Action
-
Check your hardware connections.
cachefspack: filename- can't pack file: no space left on device.
|
- Cause
-
The cache is out of disk space.
- Action
-
You need to increase the
size of the cache by increasing disk space.
cachefspack: filename - can't unpack file: permission denied
|
- Cause
-
You might not have the correct
permissions to access the file or directory.
- Action
-
Set the correct permissions.
cachefspack: filename - can't unpack file: no such file or directory
|
- Cause
-
You might not have the correct
file or directory.
- Action
-
Check for a possible typo.
cachefspack: filename- can't unpack file: stale NFS file handle
|
- Cause
-
The file or directory might
have been moved or deleted from the server at the time you attempted to access
it.
- Action
-
Verify that the file or directory
on the server is still accessible.
cachefspack: filename - can't unpack file: interrupted system call
|
- Cause
-
You might have pressed Control-C
inadvertently while issuing the command.
- Action
-
Reissue the command.
cachefspack: filename- can't unpack file I/O error
|
- Cause
-
You might have a hardware
problem.
- Action
-
Check your hardware connections.
cachefspack: only one `d', `i', `p', or `u' option allowed
|
- Cause
-
You entered more than one
of these options in a command session.
- Action
-
Select one option for the
command session.
cachefspack: can't find environment variable.
|
- Cause
-
You forgot to set a corresponding
environment variable to match the $ in your configuration
file.
- Action
-
Define the environment variable
in the proper location.
cachefspack: skipping LIST command - no active base
|
- Cause
-
A LIST
command is present in your configuration file that has no corresponding BASE command.
- Action
-
Define the BASE command.
Collecting CacheFS Statistics (Task Map)
The following task map shows the steps involved in collecting CacheFS
statistics. All the procedures in this table are optional.
Collecting CacheFS Statistics
Collecting CacheFS statistics enable you to do the following:
These statistics will help you determine the trade-off between your
cache size and the desired performance of the cache.
The CacheFS statistics commands consist of the following:
|
Command
|
Man Page
|
Description
|
|
cachefslog
|
cachefslog(1M)
|
Specifies the location of the log file. This command also displays where the
statistics are currently being logged, and enables you to stop logging.
|
|
cachefswssize
|
cachefswssize(1M)
|
Interprets the log file to give a recommended cache size.
|
|
cachefsstat
|
cachefsstat(1M)
|
Displays statistical information about a specific file system or all CacheFS
file systems. The information provided in the output of this command is taken
directly from the cache.
|
Note –
You can issue the CacheFS statistics commands from any directory.
You must be superuser to issue the cachefswssize command.
The CacheFS statistics begin accumulating when you create the log file.
When the work session is over, stop the logging by using the cachefslog -h command, as described in How to Stop CacheFS Logging.
Before using the CacheFS statistics commands, you must do the following:
-
Set up your cache by using the cfsadmin
command.
-
Decide on an appropriate length of time to allow statistical
information to collect in the log file you create. The length of time should
equal a typical work session. For example, a day, a week, or a month.
-
Select a location or path for the log file. Make sure that
there is enough space to allow for the growth of the log file. The longer
you intend to allow statistical information to collect in the log file, the
more space you need.
Note –
The following procedures are presented in a recommended order.
The order is not required.
How to Set Up CacheFS Logging
-
Set up logging.
$ cachefslog -f log-file-path /mount-point
|
|
-f
|
Sets up logging.
|
|
log-file-path
|
Specifies the location of the log file.
The log file is a standard file you create with an editor, such as vi.
|
|
/mount-point
|
Designates the mount point (CacheFS
file system) for which statistics are being collected.
|
-
Verify that you correctly set up the log file.
$ cachefslog /mount-point
|
Example—Setting Up CacheFS Logging
The following example shows how to set up the /var/tmp/samlog log file to collect statistics about the /home/sam
directory.
$ cachefslog -f /var/tmp/samlog /home/sam
/var/tmp/samlog: /home/sam
|
How to Locate the CacheFS Log File
You can also use the cachefslog command with no options
to locate a log file for a particular mount point.
$ cachefslog /mount-point
|
/mount-point specifies the CacheFS file system
for which you want to view the statistics.
The following example shows what you would see if a log file has been
set up. The location of the log file is /var/tmp/stufflog.
$ cachefslog /home/stuff
/var/tmp/stufflog: /home/stuff
|
The following example shows that no log file has been set up for the
specified file system.
$ cachefslog /home/zap
not logged: /home/zap
|
How to Stop CacheFS Logging
Use the cachefslog -h option to stop
logging.
$ cachefslog -h /mount-point
|
The following example shows how to stop logging on /home/stuff.
$ cachefslog -h /home/stuff
not logged: /home/stuff
|
If you get a system response other than the one specified here, you
did not successfully stop logging. Check to see if you are using the correct
log file name and mount point.
How to View the Working Set (Cache) Size
You might want to check if you need to increase the size of the cache.
Or, you might want to determine what the ideal cache size is based on your
activity since you last used the cachefslog command for
a particular mount point.
-
Become superuser on the client system.
-
View the current cache size and highest logged cache size.
# cachefswssize log-file-path
|
For more information, see cachefswssize(1M).
Example—Viewing the Working Set (Cache) Size
In the following example, the end size is the size
of the cache at the time you issued the cachefswssize command.
The high water size is the largest size of the cache during
the time frame in which logging occurred.
# cachefswssize /var/tmp/samlog
/home/sam
end size: 10688k
high water size: 10704k
/
end size: 1736k
high water size: 1736k
/opt
end size: 128k
high water size: 128k
/nfs/saturn.dist
end size: 1472k
high water size: 1472k
/data/abc
end size: 7168k
high water size: 7168k
/nfs/venus.svr4
end size: 4688k
high water size: 5000k
/data
end size: 4992k
high water size: 4992k
total for cache
initial size: 110960k
end size: 30872k
high water size: 30872k
|
Viewing CacheFS Statistics
You might want to view certain information about a specific CacheFS
file system. The following table explains the terminology that is displayed
in the statistics output.
Table 40–2 CacheFS Statistics Terminology
|
Output Term
|
Description
|
|
cache hit rate
|
The rate of cache hits versus cache
misses, followed by the actual number of hits and misses. A cache hit occurs
when the user wants to perform an operation on a file or files, and the file
or files are actually in the cache. A cache miss occurs when the file is not
in the cache. The load on the server is the sum of cache misses, consistency
checks, and modifications (modifies).
|
|
consistency checks
|
The number of consistency checks performed,
followed by the number that passed, and the number that failed.
|
|
modifies
|
The number of modify operations. For
example, writes or creates.
|
How to View CacheFS Statistics
View the statistics with the cachefsstat command.
You can view the statistics at any time. For example, you do not have to set
up logging in order to view the statistics.
$ cachefsstat /mount-point
|
/mount-point specifies the CacheFS file system
for which you want to view the statistics.
If you do not specify the mount point, statistics for all mounted CacheFS
file systems will be displayed.
For more information, see cachefsstat(1M).
Example—Viewing CacheFS Statistics
This example shows how to view statistics on the cached file system, /home/sam.
$ cachefsstat /home/sam
cache hit rate: 73% (1234 hits, 450 misses)
consistency checks: 700 (650 pass, 50 fail)
modifies: 321
garbage collection: 0
|