{"record":{"id":"05ef70c5ee9897dc","repo":"apache/cassandra","slug":"memtable-cleanup-threshold-is-set-very-low-w","errorCode":null,"errorMessage":"memtable_cleanup_threshold is set very low [{}], which may cause performance degradation","messagePattern":"memtable_cleanup_threshold is set very low \\[(.+?)\\], which may cause performance degradation","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":960,"sourceCode":"\n        if (conf.memtable_flush_writers < 1)\n            throw new ConfigurationException(\"memtable_flush_writers must be at least 1, but was \" + conf.memtable_flush_writers, false);\n\n        if (conf.memtable_cleanup_threshold == null)\n        {\n            conf.memtable_cleanup_threshold = (float) (1.0 / (1 + conf.memtable_flush_writers));\n        }\n        else\n        {\n            logger.warn(\"memtable_cleanup_threshold has been deprecated and should be removed from cassandra.yaml\");\n        }\n\n        if (conf.memtable_cleanup_threshold < 0.01f)\n            throw new ConfigurationException(\"memtable_cleanup_threshold must be >= 0.01, but was \" + conf.memtable_cleanup_threshold, false);\n        if (conf.memtable_cleanup_threshold > 0.99f)\n            throw new ConfigurationException(\"memtable_cleanup_threshold must be <= 0.99, but was \" + conf.memtable_cleanup_threshold, false);\n        if (conf.memtable_cleanup_threshold < 0.1f)\n            logger.warn(\"memtable_cleanup_threshold is set very low [{}], which may cause performance degradation\", conf.memtable_cleanup_threshold);\n\n        if (conf.concurrent_compactors == null)\n            conf.concurrent_compactors = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(), conf.data_file_directories.length)));\n\n        if (conf.concurrent_compactors <= 0)\n            throw new ConfigurationException(\"concurrent_compactors should be strictly greater than 0, but was \" + conf.concurrent_compactors, false);\n\n        applyConcurrentValidations(conf);\n        applyRepairCommandPoolSize(conf);\n        applyThresholdsValidations(conf);\n\n        if (conf.concurrent_materialized_view_builders <= 0)\n            throw new ConfigurationException(\"concurrent_materialized_view_builders should be strictly greater than 0, but was \" + conf.concurrent_materialized_view_builders, false);\n\n        if (conf.num_tokens != null && conf.num_tokens > MAX_NUM_TOKENS)\n            throw new ConfigurationException(String.format(\"A maximum number of %d tokens per node is supported\", MAX_NUM_TOKENS), false);\n\n        try","sourceCodeStart":942,"sourceCodeEnd":978,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L942-L978","documentation":"A warning logged when memtable_cleanup_threshold is set below 0.1 (but still valid, i.e. >= 0.01). A very low threshold means memtable cleanup work is triggered more aggressively relative to available memory, which can degrade write performance. It is advisory; startup proceeds.","triggerScenarios":"Starting a node with an explicit memtable_cleanup_threshold value in [0.01, 0.1) in cassandra.yaml; the check runs in applySimpleConfig after the range validation.","commonSituations":"Hand-tuned configs from old clusters attempting to delay flushes; copy-pasted tuning advice; configs written when the setting was still meaningful and kept after upgrades.","solutions":["Remove memtable_cleanup_threshold from cassandra.yaml (the setting is deprecated anyway).","If tuning flush behavior, use memtable_space/memtable_offheap_space and concurrent_compactors instead."],"exampleFix":"// cassandra.yaml before\nmemtable_cleanup_threshold: 0.05\n// after\n# removed - deprecated; tune via memtable_space instead","handlingStrategy":"validation","validationCode":"Object v = yamlConfig.get(\"memtable_cleanup_threshold\");\nif (v instanceof Number && ((Number) v).floatValue() < 0.1f) {\n    throw new IllegalStateException(\"memtable_cleanup_threshold below 0.1 degrades performance; remove it (deprecated)\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid manual tuning of removed/deprecated memtable settings","Use memtable_space-based tuning recommended by current docs","Check startup logs for warnings after each config change"],"tags":["cassandra","configuration","performance","deprecation"],"backgroundTag":"invalid-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}