If you receive a "disk full" message or a Queue full error when you write data to a Kafka topic, ApsaraMQ for Kafka executes different message cleanup policies based on disk usage. These policies prevent server breakdowns due to insufficient disk capacity and ensure service availability.
Cleanup policies
Cleanup policies vary based on the instance edition and topic type.
Non-Serverless instances with cloud storage topics
Disk usage < 75%: Messages that exceed the Message Retention Period are deleted at 04:00 every day.
Disk usage is between 75% and 85%: Messages that exceed the Message Retention Period are deleted periodically until disk usage drops below 75%.
Disk usage is between 85% and 90%: The earliest stored messages on the server-side are purged in chronological order, regardless of whether they have exceeded the Message Retention Period.
Disk usage ≥ 90%: To ensure stability, the service is write-protected, and new messages cannot be written.
Non-Serverless instances with local storage topics
Disk usage < 83%: Messages are deleted based on the configured TTL.
Disk usage is between 83% and 88%: Up to 10% of stored messages in each partition are purged in chronological order, regardless of the message retention period.
Disk usage ≥ 88%: To ensure stability, the service is write-protected, and new messages cannot be written.
Serverless instances
Messages are deleted based on the configured TTL.
To ensure business health and sufficient message backtracking capabilities, maintain your disk usage at 70% or lower.
Message cleanup is managed dynamically. Manual deletion is not supported.
You can view the disk usage on the tab of the Instance Details page. For more information, see Cloud Monitor. In scenarios with small disk capacity and high traffic, the displayed monitoring data may drift.
The Total Messages on Current Server metric on the Topic Details page indicates the total number of unexpired messages that were sent to the topic. This value is not used as a basis for the cleanup policy.
Related documents
For information about why messages that exceed the Message Retention Period are not deleted, see Why are expired messages not deleted?.
If the disk is full, you can wait for expired data to be automatically deleted, or you can upgrade the instance to increase the disk capacity. For more information, see Upgrade instance configurations.