【问题标题】:mongoDB is taking too much space on disk [duplicate]mongoDB在磁盘上占用了太多空间[重复]
【发布时间】:2014-04-13 23:16:25
【问题描述】:

我插入了 1.500.000 个文档,正文如下:

{
"_id" : 712613,
"cn" : " Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. ",
"d" : 1378396279,
"s" : 1,
"c" : 1,
"tc" : 0,
"tl" : 0,
"ts" : 0,
"ua" : "",
"ub" : "",
"i" : "",
"ip" : "this is image",
"cr" : "946666,1946914,784176,127189,55197,1014487,665449,1016059,1746099,818935",
"tg" : ""
}

如您所见,我已缩短名称以减小文档大小,大约 820 个字符。
拥有 150 万份文档,使用的磁盘空间为 3GB。

为什么 mongoDB 占用这么多空间?

【问题讨论】:

  • 某处是否有文本索引?字典可能很大。

标签: mongodb diskspace database


【解决方案1】:

MongoDB 会积极地预先分配数据文件,以避免以后需要新文件时出现延迟。

链接:Why are the files in my data directory larger than data in my database?

【讨论】:

  • 看来没有办法摆脱那些大文件?
  • 有。了解 --noprealloc 和 --smallfiles 选项
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-09-08
  • 1970-01-01
  • 2015-10-07
  • 2015-03-24
  • 1970-01-01
  • 2018-07-22
相关资源
最近更新 更多