sfcache(1M)

NAME

sfcache - manages Storage Foundation SmartIO caching

SYNOPSIS

sfcache app cachearea=cachearea sybase {olap|oltp} DB_username DB_server [DB_name ]

sfcache app cachearea=cachearea oracle {olap|oltp} oracle_username ORACLE_HOME ORACLE_SID [ASM_HOME] [ASM_SID]

sfcache app [cachearea=<fscachearea>] oracle -S ORACLE_SID -H ORACLE_HOME -o setdefaults --type={OLTP | OLAP}

sfcache app [cachearea=<fscachearea>] oracle -S ORACLE_SID -H ORACLE_HOME -o set
--cachemode=
{nocache|read } {--datafile=name |--partition=name |--tablespace=name |--tablecluster=name |--filelist=name }

sfcache app [cachearea=<fscachearea>] oracle -S ORACLE_SID -H ORACLE_HOME -o {pin|unpin|list} [--datafile=name|--partition=name |--tablespace=name ]

sfcache app [cachearea=<fscachearea>] oracle -S ORACLE_SID -H ORACLE_HOME -o stat

sfcache app [cachearea=<fscachearea>] oracle -S ORACLE_SID -H ORACLE_HOME -o {enable|disable}

sfcache create [-t {VxFS|VxVM}] [size] daname[...] [cacheline_size=size] [--auto|--noauto] [--default|--reserve] [--nostripe|ncols=n] [cachearea_name]

sfcache create [-t {VxFS|VxVM}] [cacheline_size=size] [--auto|--noauto] [--default|--reserve] dg/volname

sfcache delete cachearea_name

sfcache delete --hostname=hostname cachearea_name

sfcache disable [-o purge] mount_point

sfcache disable dg/volname

sfcache enable [--auto] [--read] dg/volname

sfcache enable mount_point

sfcache flush [-r] {mount_point|file|dir}

sfcache list [-l] [cachearea_name|dg/volname]

sfcache list [-r] [mount_point|file|dir]

sfcache list [--all]

sfcache load [-r] [-o sync] {file1|dir1} [file2|dir2...]

sfcache maxsize [daname ...]

sfcache offline [--flushmeta] cachearea_name

sfcache online cachearea_name

sfcache pin [-o load] [-r] {file1|dir1} [file2|dir2...]

sfcache purge [-o force] {mount_point|fsuuid}

sfcache resize [daname...] {newsize | maxsize} cachearea_name

sfcache restore-access [-r] {mount_point|file|dir}

sfcache rmdev daname[...]

sfcache set [--pause|--resume|--read] dg/volname

sfcache set [--auto|--noauto] [memsz=size] cachearea_name

sfcache set [-r] mode={nocache|read|writeback} {file1|dir1} [file2|dir2...]

sfcache set writeback_interval=interval

sfcache set writeback_size=size

sfcache set type={default|reserve} [fscachearea] sfcache stat [-l] [-r] [-i time [-c count ] ] [cachearea_name|dg/volname|mount_point]

sfcache unpin [-r] {file1|dir1} [file2|dir2...]

DESCRIPTION

The sfcache command manages the SmartIO feature. SmartIO provides I/O caching on solid state drive (SSD) devices for Storage Foundation data objects such as volumes, file systems, and files.

The cache type can be either VxVM, for caching Veritas Volume Manager (VxVM) volumes, or VxFS, for caching Veritas File System (VxFS) objects such as files, directories, and file systems. The default is VxFS. For VxFS cache type, SmartIO provides several modes which support caching for both read I/Os and write I/Os. For VxVM cache type, SmartIO provides read-caching to support applications, such as databases, running on raw volumes.

KEYWORDS

app Applies the appropriate caching policy to different types of databases volumes, for example, INDEX volume, DATA volume etc., depending on the application type (oracle or sybase) and the application load type (OLTP or OLAP). For oracle databases, use the -o option to specify one of the following operations:
setdefaults
  Sets the defaults for the type of database, where the type is either OLTP or OLAP.
set --cachemode
  Sets the caching mode for a particular database object. The value can be nocache or read.
enable|disable
  Enables or disables caching for the Oracle database.
pin|unpin
  Pins or unpins a particular database object from the cache. The database object is an optional arguement. If you do not specify database object,all datafiles/tempfiles belonging to the specified database will be pined/unpinned/listed.
list Displays information about the cache for a particular database object.
stat Displays statistics about the cache for a particular database object.
create
  Creates a cache area using the specified devices or volumes. The create command has two formats. You can specify the disk access names of one or more devices on which to create the cache area. Alternatively, you can specify a volume and disk group to use as the cache area.
The following options are available:
-t Indicates the type. The type can be VxFS to support VxFS file system-level caching, or VxVM type to support block-level caching for VxVM volumes. By default, the type is VxFS. You cannot change the type of a cache area after it is created.
cacheline_size
  Indicates the unit of data that is cached. This option applies only for a VxVM cache area. The default cacheline size is 64K. The minimum is 16K. Generally, the default size is appropriate. However, if the read size is small and reads are distributed, then you might see better performance if you decrease the cacheline size. Similarly, if sequential reads are located close together on the disk, increasing the cachcline size might improve performance. You cannot change the cacheline size after the cache area is created.
--auto | --noauto
  Specifies the cache association type. The auto type automatically enables caching for all data objects of the specified type. To require that objects must be explicitly enabled for caching, specify the --noauto option. The default is --auto.
--default | --reserve
  This option applies only for a VxFS cache area. It specifies the VxFS cache area type. The default type automatically enables caching for all data objects for specified type for which smartiocache is not specified. To require that objects must be explicitly enabled for using a particular cache area, specify the --\reserve option. The default is --default. At most onecache area can be default and there can be any number of reserve cache areas.
--nostripe | ncols=n
  Indicates the layout options for the cache area. By default, the cache area is created over a striped volume if two or more disks are specified. Use the ncols=n option to specify the number of columns for the striped volume. Use the --nostripe option to create the cache area on a concatenated volume over the specified disks.
size Specifies the maximum size of the cache area. By default, the cache area is sized to use the entire free space on the device or devices. This option is available only if you specify the disk access names to the create operation.
cachearea_name
  Specifies a name for the cache area. If you do not specify a name, SmartIO generates a cache name by default. This option is available only if you specify the disk access names to the create operation.
delete
  Deletes the specified cache area. The cache area must be offline before you can delete the cache. You can also delete the cache area of other host using --hostname=hostname option. Cache areas of other hosts can be get using sfcache list [--all]. To delete the cache area using this option, the other host must be out of the cluster and cache area must be on remote/exported disk(s).
disable
  Stops caching for the specified data object, either a data volume and disk group, or a mount point. If you specify a volume and disk group, the disable operation purges the data in the cache by default. The disable operation is persistent by default. You can enable caching later but the cache area starts with new data. Therefore, if you want to stop caching temporarily, the preferred method is to use the set keyword with the --pause attribute.
If you specify a mount point to the disable operation, the data in the cache is preserved unless you explicitly use the -o purge option.
enable
  Starts caching on the specified data object. Use the --auto option to indicate that caching occurs whenever an auto cache area is present. Use the --read attribute to specify the read mode.
flush mount_point
  Flushes any write-back data for this file system. Only applies to VxFS type caching.
list Displays the cached file systems or volumes and their cache usage. Specify a data object such as a file, directory, or volume to list the cache status, including any user-specified pinning or modes.
For a VxFS cache area, the sfcache list command shows the caching mode for the file or directory. If the mode is not explicitly set, the file or directory inherits the caching mode of the mount point. If the mode is explicitly set for a file or directory, that value persists across remounts. The displayed caching mode may differ from the mode that is enabled for the mount point. The writeback mode is not enabled unless the file system is mounted in writeback mode. If a file or directory is set to writeback mode, but the file system is mounted in another mode, the file or directory inherits the caching mode of the mount point.
The following options to the sfcache list command are available:
-l Displays the long listing of the attributes of the VxVM cache area or the cached volume specified by dg/volname.
-r Recursively lists the attributes of the files in the directories within the specified mount point or directory, in addition to the files present in the mount point or directory.
--all Prints the cache areas of this host and if the host is in cluster, also prints the cache areas of other hosts in the cluster. For other hosts, only cache areas created on exported/remote disks are displayed.
load Loads the specified file into the cache area. The following options are available:
-r Recursively loads the files in directories present in the specified directory, in addition to the files present in the directory.
-o sync Specifies that the command does not return until all the files are loaded. If the -o sync option is not specified, the command returns and the files load in the background.
maxsize
  Displays the amount of free space in the devices that are already provisioned for caching. (Similar to the maxsize attribute for the vxassist command.) If you created the cache area on a disk volume with the dg/volname option, the name of the cache area is the specified dg/volname. SmartIO currently does not support maxsize for such a cache area.
offline
  Stops the SmartIO caching to the specified cache area. For a VxVM cache, the optional --flushmeta option creates a warm cache by flushing the metadata about the VxVM cache to the SSD. Use this option for a planned shutdown.
online
  Explicitly makes a cache area available. The device discovery and notification automatically makes the cache area available. The explicit command allows control at the file system level, if required.
pin Marks a file or directory to be held in the cache until the file or directory is deleted, truncated, or unpinned. Only applies to VxFS type caching.
purge Removes the cached contents for the specified file system. This command frees up dead space in the cache. Only applies to VxFS type caching. By default, the purge operation does not clear out the write-back logs for the fsuuid or the mount point. This behavior means that the purge fails in such cases. To override that behavior and clear out the write-back logs, use the -o force option.
resize
  Resizes the specified cache area. Specify additional devices if the existing devices do not have enough free space to grow the specified cache area to the required size. If you created the cache area on a disk volume with the dg/volname option, the name of the cache area is the specified dg/volname.
restore-access
  Restores read or write access to files that are missing write-back data. Use this command for recovery.
rmdev
  Removes the device or devices from use for caching. If the cache area no longer uses the device after a shrink operation, the device is removed from the cache disk group. A device cannot be removed if it is still in use by the cache area.
set Sets the specified attributes. For a VxFS data object (file, directory, or cache area), you can set the following attributes:
mode Sets the caching mode to one of the following:
nocache
  Specifies that the object is not cached.
read In read mode, application reads are satisfied from the cache whenever possible. Application writes go to the disk in the usual way. With each write, SmartIO synchronizes the cache to ensure data coherency between the cache and the disk (primary store). If a cache device fails, data objects cached in read mode are completely present on the disk.
writeback
  In writeback mode, an application write returns success only after the data has been written to the cache. The data is written to the disk at a later time. This gives good performance for writes, but also means that the disk copy is not always up to date. Reads are satisfied from the cache if possible, and the file system transparently loads file data into the cache. If a cache device fails, a file cached in writeback mode is not completely present on the disk. If there is a replica cache, the file system uses that replica to find the latest data and write it to the disk. If there is no replica, the disk copy of the file can be incomplete or stale.
type Sets the fscache area to one of the following: Default: Specifies that any file system can use this cache area. There can be at most one default cache area online at any given time. Reserve: Reserve cache area can be used by selected file systems only. File system can make use of smartiocache option to enable use of particular cache area. There can be any number of reserve cache areas present.

The following attributes control the caching for the specified VxVM data object (volume):
--pause Temporarily stops the caching.
--resume Resumes the caching.
--read Sets the caching to read mode.

The following attributes can be set for a cache area:
--auto Indicates that caching is enabled for all data objects associated with that cache area, unless caching is explicitly disabled for a particular data object. For a VxVM cache area, all volumes are enabled. For a VxFS cache area, all files and directories are enabled.
--noauto Indicates that the cache area does not enable caching for data objects associated with it. Caching must be explicitly enabled for specific data objects.
--memsz Specifies the maximum memory to be allocated for metadata for the cache area. This attribute is specific to VxVM type caches.

The following attributes control write-back caching:
writeback_interval
  Specifies the maximum amount of time that write-back data might remain unflushed. The default is 10 seconds.
writeback_size
  Specifies a global maximum size for the amount of dirty data to be held in the cache. By default, there is no global maximum. The global maximum must be set to at least 512MB for each file system. For cluster file systems, the maximum does not include the space used for reflection.

stat Displays the cache statistics, including cache hit rate, misses, average read and write latencies. If you specify a VxVM cache area or a cached volume in the form dg/volname, the following options are available:
-l Displays a long listing that includes the attributes of the VxVM cache area or cached volume.
-r Resets the statistics. All fields in the output are reset to zero.
-i interval
  Prints statistics periodically after the specified interval. Specify the interval in seconds.
-c count
  Stops after printing interval statistics count times.
unpin Removes the file or directory from the pinned state. Only applies to VxFS type caching.

EXAMPLES

To create a VxVM cache area on the disk ssd0_0:

sfcache create -t VxVM ssd0_0

To use the volume mydg/vol1 as a VxFS noauto cache area for read caching:


sfcache create --noauto mydg/vol1

To disable caching for a specific data volume, mydg/datavol1:


sfcache disable mydg/datavol1

To display all of the cache areas on the system:


sfcache list

To show statistics about the cache area sfcache1:


sfcache stat sfcache1

SEE ALSO

Veritas InfoScale SmartIO for Solid-State Drives Solutions Guide

vxassist(1M)


SF 7.3.1 sfcache(1M)