10.3. Memory Monitoring#

There are two types of memory:

  • System memory used by dynamic routing protocols, SSH, SNMP, etc.

  • Hugepages for Data Plane. Most memory from hugepages is allocated statically (Sessions, Mappings, Subscribers, Hash Tables), but there is also memory, which is allocated during usage (when creating pools, VRFs, or ACLs, for example).

To monitor memory correctly, we recommend using the following OIDs:

  1. Total System Memory = All Memory - All Hugepages

.1.3.6.1.4.1.2021.4.5.0 - Total System Memory
.1.3.6.1.4.1.46576.1.2.0.2.1.2.0 - HugePages Total (NUMA node0)
.1.3.6.1.4.1.46576.1.2.0.2.1.2.1 - HugePages Total (NUMA node1)

.1.3.6.1.4.1.2021.4.5.0 - (.1.3.6.1.4.1.46576.1.2.0.2.1.2.0 + .1.3.6.1.4.1.46576.1.2.0.2.1.2.1)
  1. Free system memory: Free + Buffered + Cached:

.1.3.6.1.4.1.2021.4.11.0 + .1.3.6.1.4.1.2021.4.14.0 + .1.3.6.1.4.1.2021.4.15.0
  1. Memory in vCGNAT is divided by NUMA nodes. It is better to monitor it separately:

Total Hugepages NUMA node0: .1.3.6.1.4.1.46576.1.2.0.2.1.2.0
Total Hugepages NUMA node1: .1.3.6.1.4.1.46576.1.2.0.2.1.2.1
  1. Used memory:

NUMA node0: .1.3.6.1.4.1.46576.1.2.0.2.1.4.0
NUMA node1: .1.3.6.1.4.1.46576.1.2.0.2.1.4.1
  1. Free memory:

NUMA node0: .1.3.6.1.4.1.46576.1.2.0.2.1.3.0
NUMA node1: .1.3.6.1.4.1.46576.1.2.0.2.1.3.1

Alternatively, you can use a command via CLI to determine how much memory is used:

show memory dataplane#

Display Dataplane memory information for all sockets. The output shows the vCGNAT objects and their size in Bytes. Their total size is given at the bottom of the output. The summary statistic gives the total amount of memory allocated by vCGNAT, the memory used, the free memory, and the load percentage.

Another useful command is:

show memory dataplane pools#

Display memory statistics for memory pools for all sockets. When vCGNAT is started, memory pools are allocated statically. The output shows the total, used, and free number of subscribers, mappings, sessions, etc. This command can be used to monitor memory pool utilization. If vCGNAT cannot, for example, allocate sessions from the memory pool, drops will appear in the corresponding column. The critical load value is 90%. The total number of subscribers, mappings, sessions, etc., can be changed in the platform settings. The output is as follows:

vcgnat# show memory dataplane pools
---------------------------------------------------------------------------------------
Statistics for Socket 0
---------------------------------------------------------------------------------------
                       Total         Used          Free          Drops             Load
---------------------------------------------------------------------------------------
Subscribers            1527648       161520        1366128       0                10.6%
Mappings               85027648      1096285       83931363      0                 1.3%
Sessions               85027648      1164505       83863143      0                 1.4%
Fragments              65536         0             65536         0                 0.0%
Pending Fragments      1024          2             1022          0                 0.2%
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
Statistics for Socket 1
---------------------------------------------------------------------------------------
                       Total         Used          Free          Drops             Load
---------------------------------------------------------------------------------------
Subscribers            1527648       144786        1382862       0                 9.5%
Mappings               85027648      970063        84057585      0                 1.1%
Sessions               85027648      1030252       83997396      0                 1.2%
Fragments              65536         4             65532         0                 0.0%
Pending Fragments      1024          2             1022          0                 0.2%
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
                       Total         Used          Free          Drops             Load
---------------------------------------------------------------------------------------
IPv4 neighbors         1024          12            1012          0                 1.2%
IPv6 neighbors         1024          0             1024          0                 0.0%
ARP wait_ctx 0         69632         15            69617         0                 0.0%
ARP wait_ctx 1         69632         15            69617         0                 0.0%
---------------------------------------------------------------------------------------