MongoDB Atlas 集群的数据大小是如何计算的:文档大小还是存储大小?

How is the data size of a MongoDB Atlas cluster calculated: document size or storage size?

MongoDB Atlas 在云中托管 MongoDB,并且具有各种大小 select,例如 2GB、5GB、10GB 等。

我不清楚哪种数据大小适用:在我的例子中,我有一个文档大小为 1.6 GB 的数据库,存储大小约为 0.5 GB(因为文档在存储时被压缩)。

MongoDB Atlas 的大小限制是指数据库的文档大小还是存储大小

我发现大小限制是文档大小(未压缩大小),而不是磁盘上的大小。

因此,对于文档大小为 1.6 GB、磁盘大小为 0.5 GB 的数据库,我需要在 MongoDB Atlas 上使用 2 GB 的计划。

使用的集群磁盘space是来自db.stats()

fsUsedSize

它不是 dataSize(如所选答案中所指定)。然而,它也不完全是 storageSize

我的集群有大约 5GB 的 dataSizefsUsedSize 大约 4GB,而 storageSize 大约 3GB。 ATLAS 门户显示已使用 4GB。

即使在正常的独立部署中,如果您检查存储数据文件的目录,它也会比 storageSize 大得多,但也会比 dataSize 小得多.
您会注意到 mongo 数据目录的大小与 fsUsedSize.

相同

所以,我计算出的猜测是 storageSize + 一些开销(可能以 GB 为单位)。

简而言之,您自己的部署中的 mongo 数据目录将使用什么。

根据文档,

Atlas calculates the storage limit for shared clusters based on data usage, as opposed to the storageSize metric used by non-shared clusters (which includes compression). Atlas determines data usage by summing a cluster’s dataSize and indexSize.

https://docs.atlas.mongodb.com/faq/#how-does-atlas-calculate-storage-limits-for-shared-clusters-m0-m2-m5