diff --git a/pkg/operator/ceph/file/mds/config.go b/pkg/operator/ceph/file/mds/config.go index 618976c6d..13cf0a1b7 100644 --- a/pkg/operator/ceph/file/mds/config.go +++ b/pkg/operator/ceph/file/mds/config.go @@ -74,6 +74,9 @@ func (c *Cluster) setDefaultFlagsMonConfigStore(mdsID string) error { if !c.fs.Spec.MetadataServer.Resources.Limits.Memory().IsZero() { mdsCacheMemoryLimit := float64(c.fs.Spec.MetadataServer.Resources.Limits.Memory().Value()) * mdsCacheMemoryLimitFactor configOptions["mds_cache_memory_limit"] = strconv.Itoa(int(mdsCacheMemoryLimit)) + } else if !c.fs.Spec.MetadataServer.Resources.Requests.Memory().IsZero() { + mdsCacheMemoryRequest := float64(c.fs.Spec.MetadataServer.Resources.Requests.Memory().Value()) * mdsCacheMemoryResourceFactor + configOptions["mds_cache_memory_limit"] = strconv.Itoa(int(mdsCacheMemoryRequest)) } // Set mds_join_fs flag to force mds daemon to join a specific fs diff --git a/pkg/operator/ceph/file/mds/spec.go b/pkg/operator/ceph/file/mds/spec.go index 4c3243756..56d146660 100644 --- a/pkg/operator/ceph/file/mds/spec.go +++ b/pkg/operator/ceph/file/mds/spec.go @@ -37,7 +37,8 @@ const ( // MDS cache memory limit should be set to 50-60% of RAM reserved for the MDS container // MDS uses approximately 125% of the value of mds_cache_memory_limit in RAM. // Eventually we will tune this automatically: http://tracker.ceph.com/issues/36663 - mdsCacheMemoryLimitFactor = 0.5 + mdsCacheMemoryLimitFactor = 0.5 + mdsCacheMemoryResourceFactor = 0.8 ) func (c *Cluster) makeDeployment(mdsConfig *mdsConfig, namespace string) (*apps.Deployment, error) {