Creating a shared cache object

To create a shared cache object

  1. Decide on the following characteristics that you want to allocate to the cache volume that underlies the cache object:

    • The cache volume size should be sufficient to record changes to the parent volumes during the interval between snapshot refreshes. A suggested value is 10% of the total size of the parent volumes for a refresh interval of 24 hours.

    • The cache volume can be mirrored for redundancy.

    • If the cache volume is mirrored, space is required on at least as many disks as it has mirrors. These disks should not be shared with the disks used for the parent volumes. The disks should not be shared with disks used by critical volumes to avoid impacting I/O performance for critical volumes, or hindering disk group split and join operations.

  2. Having decided on its characteristics, use the vxassist command to create the cache volume. The following example creates a mirrored cache volume, cachevol, with size 1GB in the disk group, mydg, on the disks mydg16 and mydg17:
    # vxassist -g mydg make cachevol 1g layout=mirror \
      init=active mydg16 mydg17

    The attribute init=active makes the cache volume immediately available for use.

  3. Use the vxmake cache command to create a cache object on top of the cache volume that you created in the previous step:
    # vxmake [-g diskgroup] cache cache_object \
      cachevolname=volume [regionsize=size] [autogrow=on] \
      [highwatermark=hwmk] [autogrowby=agbvalue] \
      [maxautogrow=maxagbvalue]]

    If the region size, regionsize, is specified, it must be a power of 2, and be greater than or equal to 16KB (16k). If not specified, the region size of the cache is set to 64KB.

    All space-optimized snapshots that share the cache must have a region size that is equal to or an integer multiple of the region size set on the cache. Snapshot creation also fails if the original volume's region size is smaller than the cache's region size.

    If the region size of a space-optimized snapshot differs from the region size of the cache, this can degrade the system's performance compared to the case where the region sizes are the same.

    To prevent the cache from growing automatically, specify autogrow=off. By default, autogrow=on.

    In the following example, the cache object, cobjmydg, is created over the cache volume, cachevol, the region size of the cache is set to 32KB, and the autogrow feature is enabled:

    # vxmake -g mydg cache cobjmydg cachevolname=cachevol \
      regionsize=32k autogrow=on
  4. Enable the cache object using the following command:
    # vxcache [-g diskgroup] start cache_object

    For example to start the cache object, cobjmydg:

    # vxcache -g mydg start cobjmydg

More Information

Removing a cache