This guide describes how to set memory-related EXAConf values. When deploying into a container, the container currently does not automatically respect limits set by the container manager, so values need to be adjusted manually. When moving the container to a host with different resouces, EXAConf memory values need to be adjusted manually.
This document covers these settings:
- database
MemSize(effectiveOVERALL_DBRAM) - global
Hugepages - database
AutoStart(optional operational guard)
There are settings that are not covered in this document, such as MaxSystemHeapMemory and other database settings that may be relevant to memory usage. These are not covered here but may need to be set as well.
Database startup applies a safety cap to OVERALL_DBRAM based on available node memory.
If configured DBRAM is too high, it is reduced before start.
This cap currently does not take into account container memory limits. When using a container, the calculation below must be done manually
Maximum DBRAM in MiB is calculated as:
- if
node_memory_in_mib < 2048:int(node_memory_in_mib * 0.7) * db_nodes_number - otherwise:
node_mem_gb = node_memory_in_mib / 1024.0os_memory_gb = sqrt(0.8 * node_mem_gb) * log10(node_mem_gb)max_db_mem_mib = (node_memory_in_mib - int(os_memory_gb * 1024)) * db_nodes_number
The runtime cap uses the smallest active node memory among DB nodes.
Hugepages in EXAConf supports:
host: do not change/proc/sys/vm/nr_hugepages0: disable hugepages (set to0)<number>: set exactly that numberauto: derive from configured DB memory
For auto (per node):
- Start with sum of per-node DB memory for DBs on that node.
- Cap by
calc_db_memory(mem_total_mb, 1). - Subtract
MaxSystemHeapMemory(or default 32 GiB per DB if unset). - If result is greater than
60 GiB, set:nr_hugepages = hp_mem_mib * 1024 / 2048- otherwise
0.
Depending on the deployment type, two main configuration approaches are possible:
- Set global
Hugepagestoauto - set
MemSizeto total node RAM
- Inspect actual container/node resources.
- Set global
Hugepagestohostfrom the givenDBRAM(per node) as in the calculation in Hugepages Mode - Set
vm.hugetlb_shm_groupto the host group that maps to gid55554in the container - Set database
MemSizefor each DB according to actual memory available to the DB, respecting resource limits.
Set them in EXAConf through ConfD jobs (for example via confd_client):
- Set global hugepages mode:
confd_client general_settings changes: '{"Global":{"Hugepages":"auto"}}'- Set database memory size (
MemSize/OVERALL_DBRAMsource value):
confd_client db_configure db_name: DB1 mem_size: '256 GiB'In order for the database to pick up the changes, you may need to restart the database. Always verify the effective settings after making changes.
- Stop the database
confd_client db_stop db_name: DB1Start the database
confd_client db_start db_name: DB1