Configure a storage pool's caching properties
Prerequisites
Before you can configure a storage pool's cache, pool caching must be disabled on your cluster. Refer to the Disable pool caching page for more details.
Configure a storage pool's cache
Enter pool maintenance mode:
pxctl service pool maintenance --enterPool transition operation will restart PX.
Are you sure you want to proceed ? (Y/N): Y
Pool transition request submitted.Enter the
pxctl service pool cache configurecommand, specifying:
The
--modeoption with the caching<mode>The
--blocksizeoption with the<block_size>the cache usesThe
--policyoption with the caching<policy>The
--tunablesoption with the comma delimited<tunable>parametersThe
<pool_id>of the pool you're updatingpxctl service pool cache configure \
--mode [ writeback | writethrough] \
--blocksize [ cache block size, "auto"]\
--policy [ smq | mq \]\
--tunables [ one or more comma separated parameters from below ]\
<pool ID>The following example configures a pool with an ID of
0:pxctl service pool cache configure --mode writeback --blocksize "auto" --policy smq --tunables migration_threshold=2048000 0Cache parameters updated, check using 'pxctl service pool cache status 0'The
migration_thresholdparameter represents the number of 512-byte sectors allowed at any time to migrate data from either cache to origin or the other way round. Portworx automatically computes the default value of this parameter based on the assigned cache capacity for a given pool. If it's 1MB, then the default migration bandwidth is set to 100 times the cache block size at 100MB. This translates to 204800 512 byte sectors.noteNote: Use caution when running this command. If you misconfigure the
tunablearguments, Portworx may behave unexpectedly or perform poorly.
Run the
pxctl service pool cache statuscommand with the id of the pool as a parameter to check if the new settings are applied:pxctl service pool cache status 0PX Cache Configuration and Status:
Pool ID: 0
Enabled: false
Members: [/dev/sdc]
TotalBlocks: 0
UsedBlocks: 0
DirtyBlocks: 0
ReadHits: 0
ReadMisses: 0
WriteHits: 0
WriteMisses: 0
BlockSize: 1048576
Mode: writeback
Policy: smq
Tunables: migration_threshold=2048000Exit pool maintenance mode:
pxctl service pool maintenance --exitPool transition operation will restart PX.
Are you sure you want to proceed ? (Y/N): Y
Pool transition request submitted.