Question

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?)

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top