Troubleshooting Memory Usage with MongoDB

Hello everyone,

I’m writing this post to seek help with troubleshooting some performance issues I’ve been experiencing with my MongoDB deployment. Specifically, I’ve been noticing high memory consumption.

Here are some details about my deployment:

MongoDB version: 4.4.13
Storage engine: WiredTiger
Operating system: Linux/k8s deployment
Deployment method: Bitnami Helm Chart
Memory Used by Master: 17 GB Memory
Memory Used by Replica: 2 GB Memory

I’ve already tried a few things to diagnose the issues, but I’m still struggling to find the root cause. Here are some of the things I’ve done so far:

Checked the server logs: I didn't find any obvious errors or warning messages in the server logs that could explain the issues.
Checked the WiredTiger cache size: I set the --wiredTigerCacheSizeGB option to 1 GB, which I thought should be sufficient for my workload. However.
Checked the Query Cache size: I tried to check the current size of the Query Cache using the db.getProfilingStatus() command, but it looks like profiling is not activated in my deployment.
Checked the Index Cache size: I tried to check the current size of the Index Cache using the db.serverStatus().wiredTiger.cache command, but I'm not sure if I'm interpreting the results correctly.

I’m hoping that someone in the community can provide me with some guidance on how to proceed with troubleshooting these issues. Specifically, I’m looking for answers to the following questions:

How can I properly set the WiredTiger cache size and ensure that it is being used effectively?
How can I check the current size of the Query Cache and ensure that it is being used effectively?
How can I check the current size of the Index Cache and ensure that it is being used effectively?

Thank you in advance for any help or suggestions you can provide. If you need any additional details about my deployment, please let me know and I’ll be happy to provide them.

Best regards

Are you saying with wiredTigerCacheSizeGB as 1GB, mongodb is still using 17GB memo which is too high?