简体   繁体   English

MongoDB测量所需的磁盘大小

[英]MongoDB measure the disk size needed

我想知道是否有一些“经验法则”有一个近似的公式来衡量存储文件知道平均大小和文档数量需要多少,以及如果我创建一个或多个索引,这个增加多少文件。

There is but it would involve knowing what kind of indexes you specify and so forth. 但是它会涉及到您指定的索引类型等等。 If you know the average document size and the resulting padding factor than you know your data size. 如果您知道平均文档大小和生成的填充因子,则知道您的数据大小。 Add index sizes (roughly the cumulative size of all values of all index fields plus ~20 bytes per document) and journaling files if enabled. 添加索引大小(大致是所有索引字段的所有值的累积大小加上每个文档大约20个字节)和日志文件(如果已启用)。 Then round up to the nearest 2Gb (or up to the nearest 0.5Gb if --smallfiles option is enabled). 然后向上舍入到最近的2Gb(如果启用了--smallfiles选项,则向上舍入到最接近的0.5Gb)。

It's a lot easier to extrapolate if you have real-life data since storage space goes up pretty much linearly as you add more, roughly similar data. 如果您拥有真实数据,则推断起来要容易得多,因为随着您添加更多,大致相似的数据,存储空间会线性增长。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM