3 ms·
My story: MongoDB by default pre-allocates hundreds of MB for its databases, but I had a situation where I was instantiating lots and lots of small databases t
by kentonv 13y ago
My story: MongoDB by default pre-allocates hundreds of MB for its databases, but I had a situation where I was instantiating lots and lots of small databases that only needed to hold a kB or two of data each. Command-line flags could only get the prealloc down to 32-ish MB. By twiddling some constants in the Mongo source code I got it down to the few kB I wanted.
Granted, MongoDB is not meant to be used for small databases (the name comes from hu-mongo-us), but the app I was using was written against Mongo and changing that would have been a whole lot harder than modifying some constants.
Changes here, BTW:
https://github.com/kentonv/mongo/commit/14f391a000134e5d9d65bb14a6110e5a5b0be61d https://github.com/kentonv/mongo/commit/14f391a000134e5d9d65...