What's the maximum size for GridFS on MongoDB?

痞子三分冷 提交于 2021-02-07 07:20:54

问题


Basically I have a quite simple questions, but I was not able to find the answer in the MongoDB documentation or using Google.

What I want to know is, whether there is a upper limit of how big a MongoDB based GridFS may become?

(I know that the default maximum file size is 16 MByte, and that you can exceed this limit by using GridFS. But what is the upper limit for all files in GridFS?)


回答1:


MongoDB uses the operating system's mmapped IO as storage engine. The theoretical maximum, if there are no other limits imposed by implementation details, would be the amount of virtual memory your OS can assign to the mongod process. On a 32 bit OS, you will run into this limit very quickly. On windows for example, by default half the address space is reserved for the OS, so your mongod instance will stop accepting writes at a size of around 2 Gb

On a 64 bit OS, this theoretical maximum is quite a bit larger - 64 bits worth of it, in the order of millions of terabytes if I'm not mistaken. You will reach another limit before you reach this one.

EDIT:

This may no longer be true as of MongoDB 3.0. The WiredTiger storage engine works in a different way.




回答2:


I think the limit is only in your hardware, mainly disk space.

Theorically with MongoDB you can store all documents you want. GridFS is only a system to save bigger documents in smaller chunks.



来源:https://stackoverflow.com/questions/21331141/whats-the-maximum-size-for-gridfs-on-mongodb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!