Some Memory-related Indexes of MongoDB

  mongodb, question

FromThe official websiteThere are two types of WiredTiger cache

  • WiredTiger internal cache

    • 32*0.6-1 = 18GB
  • filesystem cache

    • Use as much as you can

The memory occupied by internal cache is as follows

db.serverStatus().wiredTiger.cache
 {
 "bytes currently in the cache" : 15449130304, # 15G
 "maximum bytes configured" : 19327352832,  # 19G
 }

The memory usage of the entire mongod instance

db.serverStatus().mem
 {
 
 "resident" : 24119, # 24G
 "virtual" : 27184, # 27G
 
 }

Can you say that

resident = internal cache  + filesystem cache
 ==> filesystem cache = 24 - 15 = 9G

So virtual = resident+?

Can you say that
resident = internal cache + filesystem cache
==> filesystem cache = 24 – 15 = 9G

No.WiredTigerIt is only the storage engine part of MongoDB, and the memory it occupies is not equal to the memory occupied by the whole MongoDB. In addition to it, MongoDB requires additional memory to:

  • To maintain its normal operation
  • Maintain TCP connection with client
  • Execute query
  • ……
    So the actual memory ratio usedcacheSizeGBIt is normal to be large. Usually, taking up more memory means more connections and more queries being executed at the same time. This situation is very likely due to performance problems with the queries MongoDB is running.

As forvirtual, there is no need to calculate, also does not have any meaning to you.