ceph: osd, do not auto tune osd-memory-target

As per https://github.com/ceph/ceph/pull/26856 Ceph tunes the value of
osd-memory-target when running the OSD process so there is no need to
enforce it.

We also set a safety factor to that value which has been calculated by
the Ceph eng/perf team. Without this factor, the OSD will get OOM killed
since it is consuming memory for other purposes too.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han committed 2019-04-17 00:14:04 +02:00
1 parent b7622d0fe5
commit f0b0f340f8
1 file changed
+19 -14
+19 -14
View File
@@ -39,16 +39,17 @@ import (
)
const (
dataDirsEnvVarName = "ROOK_DATA_DIRECTORIES"
osdStoreEnvVarName = "ROOK_OSD_STORE"
osdDatabaseSizeEnvVarName = "ROOK_OSD_DATABASE_SIZE"
osdWalSizeEnvVarName = "ROOK_OSD_WAL_SIZE"
osdJournalSizeEnvVarName = "ROOK_OSD_JOURNAL_SIZE"
osdsPerDeviceEnvVarName = "ROOK_OSDS_PER_DEVICE"
encryptedDeviceEnvVarName = "ROOK_ENCRYPTED_DEVICE"
osdMetadataDeviceEnvVarName = "ROOK_METADATA_DEVICE"
rookBinariesMountPath = "/rook"
rookBinariesVolumeName = "rook-binaries"
dataDirsEnvVarName = "ROOK_DATA_DIRECTORIES"
osdStoreEnvVarName = "ROOK_OSD_STORE"
osdDatabaseSizeEnvVarName = "ROOK_OSD_DATABASE_SIZE"
osdWalSizeEnvVarName = "ROOK_OSD_WAL_SIZE"
osdJournalSizeEnvVarName = "ROOK_OSD_JOURNAL_SIZE"
osdsPerDeviceEnvVarName = "ROOK_OSDS_PER_DEVICE"
encryptedDeviceEnvVarName = "ROOK_ENCRYPTED_DEVICE"
osdMetadataDeviceEnvVarName = "ROOK_METADATA_DEVICE"
rookBinariesMountPath = "/rook"
rookBinariesVolumeName = "rook-binaries"
osdMemoryTargetSafetyFactor float32 = 0.8
)
func (c *Cluster) makeJob(nodeName string, devices []rookalpha.Device,
@@ -156,8 +157,10 @@ func (c *Cluster) makeDeployment(nodeName string, selection rookalpha.Selection,
// Set osd memory target to the best appropriate value
if !osd.IsFileStore {
if !c.resources.Limits.Memory().IsZero() {
commonArgs = append(commonArgs, "--osd-memory-target", strconv.Itoa(int(c.resources.Limits.Memory().Value())))
// As of Nautilus Ceph auto-tunes its osd_memory_target on the fly so we don't need to force it
if !c.clusterInfo.CephVersion.IsAtLeastNautilus() && !c.resources.Limits.Memory().IsZero() {
osdMemoryTargetValue := float32(c.resources.Limits.Memory().Value()) * osdMemoryTargetSafetyFactor
commonArgs = append(commonArgs, fmt.Sprintf("--osd-memory-target=%f", osdMemoryTargetValue))
}
}
@@ -208,8 +211,10 @@ func (c *Cluster) makeDeployment(nodeName string, selection rookalpha.Selection,
// Set osd memory target to the best appropriate value
if !osd.IsFileStore {
if !c.resources.Limits.Memory().IsZero() {
args = append(args, "--osd-memory-target", strconv.Itoa(int(c.resources.Limits.Memory().Value())))
// As of Nautilus Ceph auto-tunes its osd_memory_target on the fly so we don't need to force it
if !c.clusterInfo.CephVersion.IsAtLeastNautilus() && !c.resources.Limits.Memory().IsZero() {
osdMemoryTargetValue := float32(c.resources.Limits.Memory().Value()) * osdMemoryTargetSafetyFactor
commonArgs = append(commonArgs, fmt.Sprintf("--osd-memory-target=%f", osdMemoryTargetValue))
}
}