- Documentation
Message Queue for Kafka
User Guide
Instance management
Instance operation
Set disk cleanup threshold
Instance operation
Set disk cleanup threshold
Set disk cleanup threshold
When the disk usage of a Kafka instance exceeds the preset disk cleanup threshold, the backend service automatically deletes old messages until the disk level recovers. This topic describes how to modify the disk cleanup threshold.
For each broker in a Kafka instance, the disk cleanup threshold is the same If the overall disk usage of the Kafka instance reaches the disk cleanup threshold, or if uneven data distribution causes a broker's disk usage to reach the threshold, some historical messages on that node will be deleted in chronological order, regardless of the message retention period, until the disk level recovers. This prevents abnormal Kafka instance operation caused by excessive disk usage and avoids replica inconsistency caused by nodes being unable to synchronize data.
The default disk cleanup threshold for Kafka instances is set to 90%. You can also set the disk cleanup threshold yourself on the instance management page. The supported range is 70% to 90%.
tip
- If the current disk usage of the instance already exceeds the new threshold, lowering the disk cleanup threshold may trigger automatic cleanup of data that exceeds the threshold. Please proceed with caution.
- We recommend that you set up alarm monitoring for the broker's disk capacity threshold. It helps to address issues before disk usage approaches the cleanup threshold and to prevent message deletion before natural aging. For recommended alarm strategy settings, refer to the instance disk usage exceeding 30% and disk skewness exceeding 30%.
- Kafka version 3.7.1 does not support setting disk cleanup threshold feature for now.
- Select the region where the instance is located in the top menu bar.
- On the Instances page, click the specified instance name.
- In the Instance details tab in the Instance configuration section, locate the Disk cleanup level.
- Click the corresponding edit icon and reset the disk cleanup threshold.
Last updated: 2026.06.08 15:09:59