Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

How to decide wiredTiger cache size bases on total server memory and MongoDB total size

Hi There,

How we can decide the wiedTiger cache size based on the server memory and total DB size.
E.g -
We have 800GB mongodb database size and 32GB memory. So what should be optimal size of wiredTiger cache size?

Note - Workload in mix or generic and this is for new deployment

Thanks,
Kailas

Hi,

There is not a straightforward answer, or even a single answer, to your question unfortunately. This is because the answer depends on your specific use case, and your specific use case will be very different from another person’s.

Generally, you want to optimize based on your “working set”. It’s the part of your data that you access frequently. Note that the term “working set” is not unique to MongoDB, and is basically universal across all databases.

Here’s a couple of good explanations on what working set is:

In general, you would know the size of your working set by experimentation and expected production load of the database.

Should you discover that your working set exceeds your RAM after some experiments, then increasing RAM is the only reliable method to increase performance.

Typically, though, the default settings of the WiredTiger cache should be workable for the vast majority of use cases.

Best regards,
Kevin

Thanks Kevin.! Got it.