Should memory used be different on different, identical nodes when both nodes are participating in a mnesia cluster?

StackOverflow https://stackoverflow.com/questions/12828241

  •  06-07-2021
  •  | 
  •  

Domanda

I have two nodes on two different, identical Virtual Machines -- both identical CentOS 64 bit, same amount of RAM, CPUs, etc.

I have mnesia clustered on those two nodes -- very vinalla, non-fragmented cluster

Node 1 shows the following

 {size,[{ttl,0,283},
        {scope_to_keys,5,97105},
        {type_to_keys,3,97043},
        {key_to_value,6015,393137},
        {schema,5,935}]}

Node 2 shows

 {size,[{ttl,0,300},
        {scope_to_keys,5,97122},
        {type_to_keys,3,97060},
        {key_to_value,6015,405184},
        {schema,5,952}]}

The tuple structure is {table_name, records, words}.

  • mnesia:info() reports that exact same numbers as above when run on each node.
  • The tables are all ram-copies
  • No transactions are on going -- no action for hours
  • mnesia:info() also reports: 33 transactions committed, 0 aborted, 9 restarted, 0 logged to disc 0 held locks, 0 in queue; 0 local transactions, 0 remote 0 transactions waits for other nodes: []

Is it normal that the two nodes report different memory used?

È stato utile?

Soluzione

What you should do is to ask the two nodes if the table contents are the same or not. Mnesia and Erlang in general collects garbage. Hence the actual use of memory in some cases might be different. Also note that it may be that one of the nodes are currently doing some maintenance work / being a leader and so on. This will make the memory be a bit different. Finally, the two nodes may be storing sub-binaries where the original binary is kept around. But when replicating, the sub-binary is cut down and copied to the other node. This accounts for a small discrepancy perhaps.

Unless there is a significant different in size. That is, one node uses something like 33% more memory, then I wouldn't worry too much.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top