High Storage Usage
If the storage usage of a DDS instance is too high or fully used, the instance becomes unavailable.
This section describes how to analyze and fix high storage usage.
Checking the Storage Usage
DDS provides the following two methods to check the storage usage of an instance:
- Check the storage usage on the DDS console.
You can log in to the DDS console and click the instance. On the Basic Information page, you can view the storage space of the instance in the Storage Space area.
Figure 1 Checking the storage usage
- View the monitoring metrics (storage usage and used storage).
To view monitoring metrics, see Viewing Monitoring Metrics.
Figure 2 Checking the storage usage
Solution
- For cluster instances, data may be unevenly distributed because the database collection is not properly sharded. As a result, the storage usage is high.
To shard the database collection properly, see How Do I Improve Database Performance by Configuring Sharding?
- As service data increases, the original database storage is insufficient. You can expand the storage space to fix this problem.
- To scale up storage for cluster instances, see Scaling Up a Cluster Instance.
- To scale up storage for replica set instances, see Scaling Up a Replica Set Instance.
- To scale up storage for single node instances, see Scaling Up a Single Node Instance.
If the storage space has reached the upper limit of your instance class, change the instance class first.
- To change the cluster instance class, see Changing a Cluster Instance Class.
- To change the replica set instance class, see Changing a Replica Set Instance Class.
- To change the single node instance class, see Changing a Single Node Instance Class.
- If a large number of expired files occupy the storage space, delete the expired files in time. For example, if the entire database is no longer used, run dropDatabase to delete it.
- The background data processing mechanism is faulty.
Operations such as write, update, and delete (including index insert and delete) are actually converted to write operations in the background. When data of an instance in use is deleted, the disk space is not reclaimed. Such unreclaimed disk space is called disk fragments. When new data is inserted, these fragments are reused without applying for new disk space. Different underlying storage engines (RocksDB and WiredTiger) vary according to specific scenarios.
After deleting data, RocksDB directly converts the delete operation to append write. After a certain amount of redundant data is accumulated, the background compact thread is automatically triggered to merge and aggregate data of multiple versions to release redundant disk space. You are advised to wait for the system to automatically reclaim the disk space. If the disk space usage is high and close to the read-only threshold, contact Huawei technical support.
After deleting data, WiredTiger merges and aggregates data of multiple versions, causing disk space fragments. However, WiredTiger does not return the disk space to the operating system. WiredTiger marks the disk space for subsequent writes of the current collection, the reserved disk space is preferentially used for subsequent writes of the collection. To release the disk space, run the compact command. (Note: This command blocks normal services and is disabled by default.)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot