如何在AWS document documentdb中紧凑磁盘空间

发布于 2025-01-31 02:11:48 字数 271 浏览 6 评论 0 原文

在删除了DocumentDB数据库中的许多文档之后,我将收藏夹降低到2.7GB,但StorageSize仍保持在11GB。有什么方法可以释放这个空间吗?

在MongoDB的Wiredtiger实施中,有一个“ compact ”命令。但是,当在DocumentDB上运行时,这会产生:“ ERRMSG”:“不支持功能:Compact”

即使删除后,我的可释放内存也不会增加。我本来希望缓存的文件占用更少的空间。似乎所有11GB仍在缓存。

After deleting many documents in my DocumentDB database, I reduced my collection to a size of 2.7GB but storageSize remains at 11GB. Is there any way to free up this space?

In the WiredTiger implementation for MongoDB, there's a "compact" command. But when run on DocumentDB this produces: "errmsg" : "Feature not supported: compact"

Even after deletion my freeable memory did not increase. I would have expected the cached documents to take up less space. It seems like all 11GB are still cached.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

破晓 2025-02-07 02:11:48

根据最新

从Amazon DocumentDB 4.0开始,当删除数据时,例如通过删除集合或索引,总体分配的空间减少了可比的量。因此,您可以通过删除不再需要的收集,索引和数据库来减少存储费用。使用Amazon DocumentDB 3.6,当删除数据时,例如通过删除集合或索引,总体分配的空间保持不变。将来数据量增加时会自动重复使用自由空间。

DocumentDB 4.0将自动紧凑空间,因为3.6将保持高水位。

According to latest official doc :

Starting with Amazon DocumentDB 4.0, when data is removed, such as by dropping a collection or index, the overall allocated space decreases by a comparable amount. Thus, you can reduce storage charges by deleting collections, indexes, and databases that you no longer need. With Amazon DocumentDB 3.6, when data is removed, such as by dropping a collection or index, the overall allocated space remains the same. The free space is reused automatically when the data volume increases in the future.

DocumentDB 4.0 will compact the space automatically, as for 3.6 will keep a high water mark.

那一片橙海, 2025-02-07 02:11:48

亚马逊指出,这是预期的($$)行为。从他们的 documentation

存储成本基于存储“高水位”(在任何时间点为Amazon DocumentDB群集分配的最大金额)

才能解决您需要将MongoDB工具用于全新的集群:

如果从Amazon DocumentDB群集中删除数据会导致大量分配但未使用的空间,重置高水位,则需要使用Mongodump或Mongorestore等工具进行逻辑数据转储并将其还原到新集群。创建和恢复快照不会减少分配的存储空间,因为基础存储的物理布局在还原的快照中保持不变。

Amazon states this is expected ($$) behavior. From their documentation:

storage costs are based on the storage "high water mark" (the maximum amount that was allocated for the Amazon DocumentDB cluster at any point in time)

To resolve you need to use MongoDB tooling into a brand new cluster:

If removing data from an Amazon DocumentDB cluster results in a substantial amount of allocated but unused space, resetting the high water mark requires doing a logical data dump and restore to a new cluster, using a tool such as mongodump or mongorestore. Creating and restoring a snapshot does not reduce the allocated storage because the physical layout of the underlying storage remains the same in the restored snapshot.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文