In SSDs, in addition to journal partitions that record operations, some partition spaces are used as cache to accelerate data reads and writes.
View the sizes and proportions of active cache, inactive cache, clean cache, and sufficient cache on a node.
Note:
The sum of the above four metrics may differ from the total cache size because a portion of the cache partition is reserved as the cluster's performance partition, which is excluded from the first three metrics.
Procedure
Run the following command on a cluster node:
zbs-chunk [--ins_id <id>] cache list
| Parameter | Description |
|---|---|
--ins_id <id> | Optional. The physical disk pool ID. This parameter can be used to filter and display information for a specific physical disk pool in environments with multiple physical disk pools. |
Output example
====ALL INSTANCES CACHE SUMMARY====
CACHE HIT RATE: 1.0
TOTAL ACTIVE: 0B ( 0.00%)
TOTAL INACTIVE: 0B ( 0.00%)
TOTAL CLEAN: 0B ( 0.00%)
TOTAL PERF USED: 681.07G ( 6.04%)
TOTAL FREE: 10.34T (93.96%)
TOTAL: 11.01T
======== ============== ================================================= ==================================== =============== ============= ========== ============= ==================================== =========== ============ ===========
INS ID PATH DEVICE ID UUID NUM IO ERRORS STATUS ERRFLAGS NUM SLOW IO PART UUID WARNFLAGS TOTAL SIZE USED SIZE
======== ============== ================================================= ==================================== =============== ============= ========== ============= ==================================== =========== ============ ===========
1 /dev/nvme0n1p4 nvme-eui.01000000000000005cd2e4fbb1e35551-part4 47cc2154-ca41-456f-80ab-cb1b53916e4f 0 CACHE_MOUNTED 0 0 6a1c9e11-1964-456c-89da-8d6f6d934ffb 0 2.61 TiB 321.07 GiB
2 /dev/nvme1n1p4 nvme-INTEL_SSDPF2KE032T1_BTAX3161016C3P8CGN-part4 e9cc8c41-c9ef-4a65-9773-82ba7f8ef405 0 CACHE_MOUNTED 0 0 ced654e4-6b2d-4344-8627-6a8e57b41e44 0 2.61 TiB 120.00 GiB
3 /dev/nvme2n1p2 nvme-INTEL_SSDPF2KE032T1_PHAX331404UY3P8CGN-part2 d4f180ad-5b8d-40af-9568-ec870db4716e 0 CACHE_MOUNTED 0 0 9fb6b81a-8e6d-4d85-94de-b4a628d1a6eb 0 2.89 TiB 120.00 GiB
4 /dev/nvme3n1p2 nvme-INTEL_SSDPF2KE032T1_PHAX325004L53P8CGN-part2 e3743e81-fab4-42c2-b8e2-ecf493ae446c 0 CACHE_MOUNTED 0 0 644079ef-5078-4c89-a14e-dadd9a3d4cd7 0 2.89 TiB 120.00 GiB
======== ============== ================================================= ==================================== =============== ============= ========== ============= ==================================== =========== ============ ===========Output note
| Parameter | Description |
|---|---|
CACHE HIT RATE | The cache hit rate. The cache represents read cache only. |
TOTAL ACTIVE | The active cache size and its percentage (excluding performance partitions). Expected to remain 0 in the long term. |
TOTAL INACTIVE | The inactive cache size and its percentage (excluding performance partitions). Expected to remain 0 in the long term. |
TOTAL CLEAN | The clean cache size and its percentage (excluding performance partitions). Expected to be greater than 0 in the long term. |
TOTAL PERF USED | The total space used by the performance tier. |
TOTAL FREE | The sufficient cache size and its percentage (including performance partitions). |
TOTAL | The total cache size (including performance partitions). |
PATH | The partition path. |
DEVICE ID | The physical disk ID. |
UUID | The unique UUID identifier of the cache partition. |
NUM IO ERRORS | The number of I/O errors. |
STATUS | The partition status. |
ERRFLAGS | The error flags. |
NUM SLOW IO | The number of slow I/Os. |
PART UUID | The unique UUID identifier of the physical partition. |
WARNFLAGS | The alarm flags. |
TOTAL SIZE | The total capacity of the cache partition. |
USED SIZE | The used space. |
Procedure
Formatting the cache partition under the specified path
Run the following command on a cluster node to format the cache partition under the specified path:
zbs-chunk [--ins_id <id>] cache format <path>
Format the cache partition with existing data under the specified path
Run the following command on a cluster node to format the cache partition with existing data under the specified path:
zbs-chunk [--ins_id <id>] cache format --force <path>
Note:
Running this command will erase all existing data on the cache partition. Proceed with caution.
Information:
In environments with multiple physical disk pools, if the specified partition is mounted by another physical disk pool, the command will fail. In this case, you must unmount the corresponding partition before running the command.
| Parameter | Description |
|---|---|
--ins_id <id> | Optional (required in a multi-physical disk pool environment). The physical disk pool ID. This parameter specifies the physical disk pool used for formatting in a multi-physical disk pool environment. |
Output example
Cache successfully formattedProcedure
Run the following command on a cluster node to mount a cache partition to the chunk under the specified path:
zbs-chunk [--ins_id <id>] cache mount <path>
| Parameter | Description |
|---|---|
--ins_id <id> | Optional (required in a multi-physical disk pool environment). The physical disk pool ID. This parameter specifies the physical disk pool used for mounting in a multi-physical disk pool environment. It must be consistent with the physical disk pool used for formatting. |
Output example
Successfully mountedProcedure
Run the following command on a cluster node to unmount the cache partition under the specified path from the chunk:
zbs-chunk cache umount <path>
Output example
Cache device is STAGING now, umount will be done in backgroundProcedure
Run the following command on a cluster node to stop unmounting the cache partition under the specified path from the chunk:
zbs-chunk cache cancel-umount <path>
Output example
Cache cancel umount submittedProcedure
Run the following command on a cluster node to unmount the cache partition under the specified path from the chunk. This operation cannot be undone:
zbs-chunk cache umount --scheme uuid --mode offline <uuid>
Output example
Cache device is STAGING now, umount will be done in backgroundProcedure
Run the following command on a cluster node to set the cache partition under the specified path to a healthy status:
zbs-chunk cache set-healthy <path>
Output example
Cache device is set healthy!Procedure
Run the following command on a cluster node to set the cache partition under the specified path to an unhealthy status:
zbs-chunk cache set-unhealthy <path>
Output example
Cache device is set unhealthy! umount and recover will be done in background