Host Memory Management ConfigurationΒΆ
TNSR has commands to tweak a few common host OS memory management parameters.
These are:
- sysctl vm nr_hugepages <u64>:
Virtual memory, maximum number of huge pages. This controls allocations of huge areas of contiguous memory, which is used to keep TNSR in memory, rather than swapping. Each huge page is 2MB by default, and the default number of huge pages is
1024
. Multiplying the values yields 2GB of RAM set aside by default.This value can be tweaked lower for systems with less memory or higher for systems with more available memory and larger workloads. For example for a system with a 6GB main heap, consider setting this value to
3072
to match.- sysctl vm nr_overcommit_hugepages <u64>:
Amount of huge pages to allocate out of main memory if the amount allocated by
nr_hugepages
is exhausted. TNSR will free these additional allocations after use. The amount allocated follows the same calculations asnr_hugepages
.Due to variations between hardware and configurations it is difficult to exactly predict amount of huge pages TNSR requires in a given environment. This setting allows for some extra temporary room when necessary.
The default value is
256
. A value of128
is sufficient for many cases.- sysctl vm max_map_count <u64>:
Virtual memory, maximum map count. This controls the number of memory map areas available to a given process. With workloads requiring larger amounts of memory, this may need increased to allow sufficient levels of memory allocation operations to succeed. The default value is
3096
.- sysctl kernel shmmem <u64>:
Maximum size, in bytes, of a single shared memory segment in the kernel. Default value is
2147483648
(2GB).
To view the current active values of these parameters, use show sysctl
:
tnsr# show sysctl
vm/nr_hugepages = 1024
vm/max_map_count = 3096
kernel/shmmax = 2147483648