Enabling

You can enable persistent write log cache (PWL) on an IBM Storage Ceph cluster by setting the Ceph RADOS block device (RBD) rbd_persistent_cache_mode and rbd_plugins options.

Important: The exclusive-lock feature must be enabled to enable persistent write log cache. The cache can be loaded only after the exclusive-lock is acquired. Exclusive-locks are enabled on newly created images by default unless overridden by the rbd_default_features configuration option or the --image-feature flag for the rbd create command. For more information about the exclusive-lock feature, see Enabling and disabling image features.

Set the persistent write log cache options at the host level by using the ceph config set command. Set the persistent write log cache options at the pool or image level by using the rbd config pool set or the rbd config image set commands.

Prerequisites

  • A running IBM Storage Ceph cluster.

  • Root-level access to the monitor node.

  • The exclusive-lock feature is enabled.

  • Client-side disks are persistent memory (PMEM) or solid-state disks (SSD).

  • RBD cache is disabled.

Procedure

  1. Enable PWL cache:

    i. At the host level, use the ceph config set command:

    Syntax

    ceph config set client rbd_persistent_cache_mode CACHE_MODE
    ceph config set client rbd_plugins pwl_cache

    Replace CACHE_MODE with rwl or ssd.

    Example

    [ceph: root@host01 /]# ceph config set client rbd_persistent_cache_mode ssd
    [ceph: root@host01 /]# ceph config set client rbd_plugins pwl_cache

    ii. At the pool level, use the rbd config pool set command:

    Syntax

    rbd config pool set POOL_NAME rbd_persistent_cache_mode CACHE_MODE
    rbd config pool set POOL_NAME rbd_plugins pwl_cache

    Replace CACHE_MODE with rwl or ssd.

    Example

    [ceph: root@host01 /]# rbd config pool set pool1 rbd_persistent_cache_mode ssd
    [ceph: root@host01 /]# rbd config pool set pool1 rbd_plugins pwl_cache

    iii. At the image level, use the rbd config image set command:

    Syntax

    rbd config image set POOL_NAME/IMAGE_NAME rbd_persistent_cache_mode CACHE_MODE
    rbd config image set POOL_NAME/IMAGE_NAME rbd_plugins pwl_cache

    Replace CACHE_MODE with rwl or ssd.

    Example

    [ceph: root@host01 /]# rbd config image set pool1/image1 rbd_persistent_cache_mode ssd
    [ceph: root@host01 /]# rbd config image set pool1/image1 rbd_plugins pwl_cache
  2. Optional: Set the additional RBD options at the host, the pool, or the image level:

    Syntax

    rbd_persistent_cache_mode CACHE_MODE
    rbd_plugins pwl_cache
    rbd_persistent_cache_path /PATH_TO_DAX_ENABLED_FOLDER/WRITE_BACK_CACHE_FOLDER <1>
    rbd_persistent_cache_size PERSISTENT_CACHE_SIZE <2>

    <1> rbd_persistent_cache_path - A file folder to cache data that must have direct access (DAX) enabled when using the rwl mode to avoid performance degradation.

    <2> rbd_persistent_cache_size - The cache size per image, with a minimum cache size of 1 GB. The larger the cache size, the better the performance.

    Example

    rbd_cache false
    rbd_persistent_cache_mode rwl
    rbd_plugins pwl_cache
    rbd_persistent_cache_path /mnt/pmem/cache/
    rbd_persistent_cache_size 1073741824