Configuring SingleStore DB for NUMA
This topic does not apply to SingleStore Managed Service.
If you are managing your cluster with MemSQL Ops, go here instead.
When running SingleStore DB on machines with multiple Non-Uniform Memory Access (NUMA) nodes, you should configure SingleStore DB for NUMA with
numactl for optimal performance. If you do not configure SingleStore DB this way, performance will be greatly degraded due to expensive cross-NUMA-node memory access. Configuring for NUMA should be done as part of the installation process; however, you can reconfigure your deployment later, if necessary.
To simplify the configuration process, the SingleStore DB management tools (
memsqlctl, etc.) can automatically detect if a host machine has multiple NUMA nodes and then configure SingleStore DB with
numactl to bind individual SingleStore DB nodes to NUMA nodes. To download and use the management tools, see the Installation Guides.
Configuring a new cluster for NUMA
On each host that will contain SingleStore DB leaf nodes, create one leaf per NUMA node by running
memsql-admin create-nodeand then
memsql-admin add-leafuntil you have the same number of SingleStore DB leaf nodes as NUMA nodes. You will need to provide a different
--portargument for each SingleStore DB node on the same host.
For example, on a host machine with two NUMA nodes, you would deploy two leaf nodes.
memsql-admin create-node --host <hostname|IP> --port 3307 --password <secure_pass>
memsql-admin create-node --host <hostname|IP> --port 3308 --password <secure_pass>
# Assign the nodes the role of "leaf" and add them to the cluster. memsql-admin list-nodes -q -r unknown | xargs -I % memsql-admin add-leaf --memsql-id % -y
memsql-admin optimizeand confirm the prompt.
This will configure
numactlto bind SingleStore DB nodes to NUMA nodes, and configure SingleStore DB memory settings.
See memsql-admin optimize for more information.
Restart the cluster for the configuration changes to take effect.
memsql-admin restart-node --all
Reconfiguring an existing cluster for NUMA
Follow the steps in the previous section to deploy and optimize your leaf nodes.
Rebalance all SingleStore DB databases by running REBALANCE ALL DATABASES.
REBALANCE ALL DATABASES;