mongoDB在磁盘上占用了太多空间

时间:2014-03-10 17:31:20

标签: mongodb diskspace database

我插入了以下正文的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占用了这么多空间?

1 个答案:

答案 0 :(得分:0)

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

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