Home > database >  Memory about mongodb3.4 confusion
Memory about mongodb3.4 confusion

Time:09-29

Hi, everybody, have a question want to ask next everybody, we recently will be directing from version 2.2.2 upgraded to 3.4.6 version, using WiredTiger engine, run after a period of time, found a few questions is not very understand,

The oplog data in the data total size (including local around 20 g)
But through the top view of memory, 104 g


Question 1: why actual use memory is bigger than the storage memory so much?
Question 2: I set up the boot parameters wiredTigerCacheSizeGB=100, but now use the memory more than 100 g, see website document, directing a memory has two parts, one is WiredTiger internal cache, one is the file system cache, wiredTigerCacheSizeGB parameter Settings should be an internal cache, that the entire mongo can use memory size by parameter Settings, if not set, it is not infinite memory (website said mongo automatically USES all free memory that is not 2 by the WiredTiger cache or by other the processes),

CodePudding user response:

You set the 100 g, the actual use 104 g this should be a normal
WiredTigerCacheSizeGB just part after all, isn't it use all memory
You can set the value is 50 g, see the effect, if only a little more than 50 or control
This memory is the amount of data than you more normal, you can also try to add some more data and added to the 200 gb or more, look at it is memory

CodePudding user response:

reference 1/f, CKC response:
set up a 100 g, you actually use 104 g this should be a normal
WiredTigerCacheSizeGB just part after all, isn't it use all memory
You can set the value is 50 g, see the effect, if only a little more than 50 or control
This memory is the amount of data than you more normal, you can also try to add some more data and added to the 200 g or more, take a look at it is memory

Hello, the 104 g is inner cache + file system cache, I checked the inner cache is 80 g, but it contains which data, 80 g hot data + index is far from the big, if does not include the oplog even less than 10 g, why there are 80 g, so want to know the 80 g contains which data, now I can think of two possible, 1: the existence of disk data structure is compressed, the existence of memory is a kind of no compression format; 2: every day we have a delete document operation (5 days before the delete data, data volume) almost every day, isn't it a document removed, memory is not deleted, this kind of situation in mmap1 engine when physical file disk usage will have such a situation, but I feel wiredtiger engine should not have such problem, let alone a memory,

CodePudding user response:

You set the 100 g, so mongo applied for 100 g, this no problem, is not to say that the 100 g must be all useful data
You only have an empty library, mongo also use 100 g, you have 200 gigabytes of data, it is used 100 g, this should be normal
Of course, if the design is good, in the case of does not need so big data also can use less, this is another issue
Eat mongo memory is bad, it may design idea is such, never consider to save memory

CodePudding user response:

Question 1: why actual use memory is bigger than the storage memory so much?
- storage data is compressed
Question 2: I set up the boot parameters wiredTigerCacheSizeGB=100, but now use the memory more than 100 g, see website document, directing a memory has two parts, one is WiredTiger internal cache, one is the file system cache, wiredTigerCacheSizeGB parameter Settings should be an internal cache, that the entire mongo can use memory size by parameter Settings, if not set, it is not infinite memory (website said mongo automatically USES all free memory that is not 2 by the WiredTiger cache or by other the processes),
- directing more greed will as much as possible the use of system memory until the system is not available memory

CodePudding user response:

Like directing itself doesn't need to manually to set what memory related things
  • Related