Setting memory parameters per cluster

To change per-cluster memory parameters

Use the following command:

vinfra memory-policy vstorage-services per-cluster change [--guarantee <guarantee>] [--swap <swap>]
                                                          [--cache-ratio <cache-ratio> --cache-minimum <cache-minimum>
                                                          --cache-maximum <cache-maximum>]
--guarantee <guarantee>
Guarantee, in bytes
--swap <swap>
Swap size, in bytes, or -1 if unlimited
--cache-ratio <cache-ratio>
Cache ratio from 0 to 1 inclusive
--cache-minimum <cache-minimum>
Minimum cache, in bytes
--cache-maximum <cache-maximum>
Maximum cache, in bytes

For example, to set the storage memory parameters for all nodes in the storage cluster, run:

# vinfra memory-policy vstorage-services per-cluster change --guarantee 8796093022208 --swap 1099511627776 \
--cache-ratio 0.5 --cache-minimum 1099511627776 --cache-maximum 3298534883328

This command sets the memory parameters as follows:

  • The memory guarantee to 8 GB
  • The swap size to 1 GB
  • The page cache limits: the minimum to 1 GB, the maximum to 3 GB, and the cache ratio to 0.5

You can view the updated per-cluster memory parameters in the vinfra memory-policy vstorage-services per-cluster show output:

# vinfra memory-policy vstorage-services per-cluster show
+-----------+------------------------+
| Field     | Value                  |
+-----------+------------------------+
| cache     | maximum: 3298534883328 |
|           | minimum: 1099511627776 |
|           | ratio: 0.5             |
| guarantee | 8796093022208          |
| swap      | 1099511627776          |
+-----------+------------------------+

To reset per-cluster parameters to default

Use the following command:

vinfra memory-policy vstorage-services per-cluster reset [--guarantee] [--swap] [--cache]
--guarantee
Reset only the guarantee.
--swap
Reset only the swap size.
--cache
Reset only cache values.

For example, to reset the manually configured page cache limits to default for all nodes in the storage cluster, run:

# vinfra memory-policy vstorage-services per-cluster reset --cache