Recently our mongo reached 50% Ram utilization, so we decided to increase the infra. Earlier Mongo was running in 16 core 32GB ram, which we increased to 32 core 62GB ram.
But we noticed that this time Mongo was utilizing only 42-43% of Ram i.e. around 25GB.
With db.serverStatus().wiredTiger.cache we found that
“bytes currently in the cache” : 25984630208
“maximum bytes configured” : 32509001728
So is there any reason why Mongo is not able to utilize the maximum allotted ram, but instead is stuck around 25GB?
WiredTiger will aim to use only 80% of the max configured cache size - One reason this is done so if there are unexpected memory spike in some workload, there are about 20% additional memory ceiling that WT can work with. Since memory is always needed to do any operation, filling the cache to 100% would likely be very detrimental to the situation. The WT cache is only part of the overall MongoDB memory usage requirement. MongoDB uses memory for incoming connections (~1MB of RAM per connection), aggregation pipeline, etc. that are outside of WT cache.
In addition to the above, the OS also needs memory for its operation and for the filesystem cache.
In saying the above, is the question more for curiosity or is there an issue you are encountering?