Memory limit on K8S pod is not honored for WiredTigerCacheSize calculation

A memory limit is not the same as available memory(at least in docker, not sure about k8s, but I assume it is the same).

To limit mongod wiredtiger cache size, specifically set it in the configuration or via command line arguments.

If you run mongod in a container (e.g. lxc , cgroups , Docker, etc.) that does not have access to all of the RAM available in a system, you must set storage.wiredTiger.engineConfig.cacheSizeGB to a value less than the amount of RAM available in the container. The exact amount depends on the other processes running in the container. See memLimitMB .

1 Like