问题描述
我想在我的新项目中使用mongodb.问题是,mongo使用预分配文件:
I want to use mongodb for my new project. the problem is, mongo use pre-alocate files :
从这里
: http://www.mongodb.org/display/DOCS /Excessive + Disk + Space
通常会有很多2GB的文件,里面什么也没有.有一个--smallfiles开关,可以将文件限制为512MB
And its normal to have many 2GB files with nothing in it. there is a --smallfiles switch, to limit this files to 512MB
我想知道使用smallfiles对生产有好处吗?还有它的缺点.
I want to know using smallfiles is good for production? and what's its drawbacks.
没有noprealloc开关,但在生产中效果不佳.但是没有关于小文件的提示.
there is noprealloc switch but its not good in production. but there is no note about smallfiles.
推荐答案
如果您要创建一堆数据库,通常只使用小文件;如果仅使用少数几个数据库进行操作,那将不会节省您的时间足以惹上麻烦.
You would usually only use smallfiles if you are creating a whole bunch of databases, if you're only operating out of a few databases it doesn't save you enough to mess with.
对于拥有许多DBS(实际上受益于小文件)的客户,我们还没有看到任何性能问题.但是,与其他安装相比,它们的活动水平通常较低.根据Mongo的操作,执行某些操作可能会稍慢一些,但我认为您永远不会注意到.
We haven't seen any performance problems with it for customers that have many, many DBS (and actually benefit from small files). Their activity level is normally somewhat low compared to other installs, though. Based on what Mongo is doing, it might be slightly slower to do some operations but I don't think you'll ever notice.
这篇关于mongo db --smallfiles切换缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!