Changing the Memory Limit for Each Node After Installation
In some cases, you may wish to change the memory limit for each node after installing SingleStore.
Note
Licensing is based on the amount of resources (memory, in this case) available in the (containerized/virtual) machine that SingleStoreDB is running on. So if you increase the amount of memory available to SingleStoreDB, make sure that your license count covers the new amount.
The process requires updating the maximum_memory
global variable in the memsql.cnf
file on each node (aggregator and each leaf) and then restarting the cluster. It is recommended to have symmetrical leaves (same amount of RAM/CPU etc. on each leaf).
1. Get the node IDs from the MEMSQL_ID
column by executing this command:
sdb-admin list-nodes
2. Suppose you want to update the master node to have maximum_memory
of 4106 MB and the leaf node to have 8108 MB. Execute these commands with the corresponding MEMSQL_ID
s:
sdb-admin update-config --key maximum_memory --value 4106 --memsql-id <MEMSQL_ID>
sdb-admin update-config --key maximum_memory --value 8108 --memsql-id <MEMSQL_ID>
3. Restart the cluster by executing this command:
sdb-admin restart-node --all
4. Check that the nodes have the amount of memory you want by querying mv_nodes
:
USE information_schema SELECT * FROM mv_nodes;
5. To see your total used cluster memory capacity execute this command:
SHOW STATUS EXTENDED LIKE 'used_cluster_capacity';
Note
Folders containing the .cnf files for the nodes are typically under: /var/lib/memsql/. To find out which subfolder corresponds to what node (the folder names are GUIDs), you can look at the port number in the memsql.cnf file in the folder named with a GUID.
Use Cases
This process can be used for a number of purposes, including to:
increase memory limits to use newly-installed memory.
leave memory for other software running on the machines.
Additional Information
Refer memsql.cnf for changing the .cnf file.