0

Already checked many questions regarding this topic, and I believe it's a miss configuration on wiredTiger, actually not using it at all I believe.

This is the memory details on the primary:

------------------------------------------------
MALLOC:     9216501736 ( 8789.5 MiB) Bytes in use by application
MALLOC: +    295092224 (  281.4 MiB) Bytes in page heap freelist
MALLOC: +   1027054880 (  979.5 MiB) Bytes in central cache freelist
MALLOC: +       251104 (    0.2 MiB) Bytes in transfer cache freelist
MALLOC: +    214021656 (  204.1 MiB) Bytes in thread cache freelists
MALLOC: +     92561664 (   88.3 MiB) Bytes in malloc metadata
MALLOC:   ------------
MALLOC: =  10845483264 (10343.1 MiB) Actual memory used (physical + swap)
MALLOC: +   7447629824 ( 7102.6 MiB) Bytes released to OS (aka unmapped)
MALLOC:   ------------
MALLOC: =  18293113088 (17445.7 MiB) Virtual address space used
MALLOC:
MALLOC:        1038376              Spans in use
MALLOC:            493              Thread heaps in use
MALLOC:           4096              Tcmalloc page size
------------------------------------------------
Call ReleaseFreeMemory() to release freelist memory to the OS (via madvise()).
Bytes released to the OS take up virtual address space but no physical memory.

This is the memory details on one of the secondaries:

------------------------------------------------
MALLOC:     9324505232 ( 8892.5 MiB) Bytes in use by application
MALLOC: +    565633024 (  539.4 MiB) Bytes in page heap freelist
MALLOC: +    333445776 (  318.0 MiB) Bytes in central cache freelist
MALLOC: +         7680 (    0.0 MiB) Bytes in transfer cache freelist
MALLOC: +    641961696 (  612.2 MiB) Bytes in thread cache freelists
MALLOC: +     64053504 (   61.1 MiB) Bytes in malloc metadata
MALLOC:   ------------
MALLOC: =  10929606912 (10423.3 MiB) Actual memory used (physical + swap)
MALLOC: +     59404288 (   56.7 MiB) Bytes released to OS (aka unmapped)
MALLOC:   ------------
MALLOC: =  10989011200 (10479.9 MiB) Virtual address space used
MALLOC:
MALLOC:         809348              Spans in use
MALLOC:            773              Thread heaps in use
MALLOC:           4096              Tcmalloc page size
------------------------------------------------
Call ReleaseFreeMemory() to release freelist memory to the OS (via madvise()).
Bytes released to the OS take up virtual address space but no physical memory.

Please correct me if I am wrong, but it seems that there is 7GB of memory in cache, that could be cleaned, correct?

The mongodb server version currently being used is 4.0.6.

And this is the section on mongod.conf related to the storage:

storage:
  dbPath: /var/lib/mongodb

There is no configuration for the maximum GB used for wiredTiger, so I believe it will use 50% of (RAM - 1 GB) for that, right? The RAM of the machine is 16GB. So that would be 7.5GB for cache, maybe its too much, I don't know, any insights on this issue?

Every few days there is the need of restarting the nodes, and it would be great to find a fix for this.

Thank you.

TiagoM
  • 3,458
  • 4
  • 42
  • 83

1 Answers1

0

What kinds of queries are you running on your system? Are they long-running queries, or queries that don't use indexes? How much data is in your database, and how much of the data do you use most of the time? What's the cache eviction rate?

Basically, it's hard to know what is 'too much' use of memory, unless you know how much of the memory is being used. If you have a 500Gb database and are querying across 200G all the time, mongodb needs more memory than a 16Gb machine has, and things will be very slow.

Are you using MongoDB's free cloud monitoring? https://docs.mongodb.com/manual/administration/free-monitoring/

Sheeri
  • 558
  • 3
  • 6