Setting memory parameters per node

To change per-node memory parameters

Use the following command:

vinfra memory-policy vstorage-services per-node change [--guarantee <guarantee>] [--swap <swap>]
                                                       [--cache-ratio <cache-ratio> --cache-minimum <cache-minimum>
                                                       --cache-maximum <cache-maximum>] --node <node>
--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
--node <node>
Node ID or hostname

For example, to set the storage memory parameters for the node node001, run:

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

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-node memory parameters in the vinfra memory-policy vstorage-services per-node show output:

# vinfra memory-policy vstorage-services per-node show --node node001
+-----------+-------------------------+
| Field     | Value                   |
+-----------+-------------------------+
| cache     | maximum: 13194139533312 |
|           | minimum: 8796093022208  |
|           | ratio: 0.7              |
| guarantee | 8796093022208           |
| swap      | 1099511627776           |
+-----------+-------------------------+

To reset per-node parameters to default

Use the following command:

vinfra memory-policy vstorage-services per-node reset [--guarantee] [--swap] [--cache] --node <node>
--guarantee
Reset only the guarantee.
--swap
Reset only the swap size.
--cache
Reset only cache values.
--node <node>
Node ID or hostname

For example, to reset the manually configured page cache limits to default for the node node001, run:

# vinfra memory-policy vstorage-services per-node reset --cache --node node001