How can I customize the memory limit for each node after installation?


#1

I am planning to install the MemSQL in 2 VM’s with each having 64 GB RAM and plan to have 2 nodes in each VM (1 VM with 1-aggregator and 1-leaf and other VM with 2-Leafs). Is this suggested option? is there anyway/option to set the memory to a Node (Leaf or Aggregator) say 32 GB?

I had initially installed 1-Aggregator+1-Leaf in 1-VM and 1-Leaf in another VM. I knew this may not be very optimal way, but I see cluster counting the total memory as ~ 180

pls advise


#2

Sure, you can do this. It’s recommended to have symmetrical leaves (same amount of RAM/CPU etc. on each leaf). I’d recommend something like this for your situation for the maximum_memory setting for each node:

master agg: 16GB
leaf 1: 48GB
leaf 2: 48GB

(assuming you want to total at most 128GB). Put the master agg on machine 1, leaf 1 on machine 1, and leaf 2 on machine 2.

If you want redundancy 2 and HA then put a child aggregator on machine 2, also 16GB.

See this on configuring memory limits in MemSQL: https://docs.memsql.com/concepts/v6.7/memory-management/#configuring-memory-limits

See this on the installation process:


#3

See also this related to errors associated with going over the memory limit for a free 128GB capacity cluster:


#4

thank you @hanson
just wanted to check how do we specify the memory configuration by node wise (like 48 GB for Leaf)


#5

Update the maximum_memory global variable in the memsql.cnf file on each node (agg, leaf1, and leaf2) to be what you want, then restart the cluster. You can do this with memsql-admin similar to the following (I’m running a single agg and leaf on one machine for this example, but you can do something similar for your scenario):

First, get the node IDs:

vagrant@memsqldev ~ $ memsql-admin list-nodes
+------------+--------+-----------+------+---------------+--------------+---------+----------------+--------------------+
| MemSQL ID  |  Role  |   Host    | Port | Process State | Connectable? | Version | Recovery State | Availability Group |
+------------+--------+-----------+------+---------------+--------------+---------+----------------+--------------------+
| 52EBC44525 | Master | 127.0.0.1 | 3306 | Running       | True         | 6.7.1   | Online         |                    |
| 77C92E61CA | Leaf   | 127.0.0.1 | 3308 | Running       | True         | 6.7.1   | Online         | 1                  |
+------------+--------+-----------+------+---------------+--------------+---------+----------------+--------------------+

Now, let’s say we want to update the master node to have maximum_memory = 4106 KB and the leaf node to have 8108 KB. We’d do this:

memsql-admin update-config --key maximum_memory --value 4106 --memsql-id 52EBC44525
memsql-admin update-config --key maximum_memory --value 8108 --memsql-id 77C92E61CA
memsql-admin restart-node --all

Then, you can check that the nodes have the amount of memory you want by querying mv_nodes:

$ memsql
Welcome to the MySQL monitor...

memsql> use information_schema
Database changed

memsql> select * from mv_nodes;
+----+-----------+------+------+--------+--------------------+----------+---------------+---------------------+----------------+----------------------+--------------------+------------------------+
| ID | IP_ADDR   | PORT | TYPE | STATE  | AVAILABILITY_GROUP | NUM_CPUS | MAX_MEMORY_MB | MAX_TABLE_MEMORY_MB | MEMORY_USED_MB | TABLE_MEMORY_USED_MB | TOTAL_DATA_DISK_MB | AVAILABLE_DATA_DISK_MB |
+----+-----------+------+------+--------+--------------------+----------+---------------+---------------------+----------------+----------------------+--------------------+------------------------+
|  2 | 127.0.0.1 | 3308 | LEAF | online |                  1 |        4 |          8108 |                7084 |           2889 |                  250 |              98396 |                  80201 |
|  1 | 127.0.0.1 | 3306 | MA   | online |               NULL |        4 |          4106 |                3082 |            839 |                   51 |              98396 |                  80201 |
+----+-----------+------+------+--------+--------------------+----------+---------------+---------------------+----------------+----------------------+--------------------+------------------------+

You can see your total used cluster memory capacity as follows:

memsql> show status extended like 'used_cluster_capacity';
+-----------------------+----------+
| Variable_name         | Value    |
+-----------------------+----------+
| Used_cluster_capacity | 12214 MB |
+-----------------------+----------+

This must be at most 131072 MB, which is 128 * 1024 MB, for the free license version.

For more background, see the documentation here regarding changing the .cnf file:

Folders containing the .cnf files for the nodes are typically under: /var/lib/memsql/. To tell what 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. This is not really necessary since you can use memsql-admin to do what you need, as outlined above. But you can see the effects this way.


#6

FYI @madhusudhana_podila, I updated the title of your topic to be more discoverable by others if they run into a similar problem.


#7

thank you @memsqlpubs