I just ran an instance of 1.8.2 running with --smallfiles and --quotafiles=8, then kept inserting a large string until the db was full.
It looks like I was wrong and the max size is 512Mb per file, sorry about the confusion there.
Given that, it looks like you will want to use quotafiles=12 to create a 4Gb cap.
I don't believe this behavior has been changed since 1.8.2, but if you're running with something later, it should be easy to write something to confirm this behavior. I just did:
str = "AAAAA"
while (str.length < 1024*1024){ str+=str}
for (var i =0; i < 5000; i++) { db.foo.insert({a:str})}
That should fill up your database pretty quickly if you're using --smallfiiles and --quotafiles=12, then you can verify that the file sizes look as you expect.
Hope that helps clear things up!
-Spencer
On Mon, Aug 1, 2011 at 4:09 PM, Matt
<ma...@ziplinegames.com> wrote:
Hi Spencer,
Apologies for bugging you directly (I'll repost on the forum as
appropriate) but I was wondering if you could confirm for me the
maximum pre-allocated file size when using --smallfiles. You
indicated below that they grow to 1GB but a later post suggested that
they grow only to 512MB.
Also, is this behavior any different in 1.9+ than in 1.8.x?
Thanks much for your help.
Cheers!
-Matt Towers