Right now I'm limiting by using --quota and --quotaFiles, which works in a
way, but I'm not sure how much space I've got left... is there a way to
implement this? I need to make a small pie chart to display that.
The only solution I'm thinking is to use db.stats() and "fileSize". So,
fileSize would be 100%, but dataSize would be the actual used...
Unfortunately there's no built in flag to cap the total database size. As you've discovered, the --quota option will limit the number of data files and hence the total filesize. But figuring out the remaining space is a little tricky, since some of the space in the datafiles is for indexes. Also, if you're deleting documents, then fragmentation in the data files might mean that not all of the remaining space is usable. fileSize minus dataSize will give you a rough estimate of the remaining space, but it won't be strictly accurate, so should be taken with a grain of salt. .
On Tuesday, July 3, 2012 1:54:36 PM UTC-4, oct wrote:
> Hi,
> Is %subj% even possible?
> Right now I'm limiting by using --quota and --quotaFiles, which works in a > way, but I'm not sure how much space I've got left... is there a way to > implement this? I need to make a small pie chart to display that.
> The only solution I'm thinking is to use db.stats() and "fileSize". So, > fileSize would be 100%, but dataSize would be the actual used...
On Tue, Jul 3, 2012 at 1:37 PM, Kevin Matulef <matu...@10gen.com> wrote:
> Unfortunately there's no built in flag to cap the total database size. As
> you've discovered, the --quota option will limit the number of data files
> and hence the total filesize. But figuring out the remaining space is a
> little tricky, since some of the space in the datafiles is for indexes.
> Also, if you're deleting documents, then fragmentation in the data files
> might mean that not all of the remaining space is usable. fileSize minus
> dataSize will give you a rough estimate of the remaining space, but it
> won't be strictly accurate, so should be taken with a grain of salt. .
> -Kevin
> On Tuesday, July 3, 2012 1:54:36 PM UTC-4, oct wrote:
>> Hi,
>> Is %subj% even possible?
>> Right now I'm limiting by using --quota and --quotaFiles, which works in
>> a way, but I'm not sure how much space I've got left... is there a way to
>> implement this? I need to make a small pie chart to display that.
>> The only solution I'm thinking is to use db.stats() and "fileSize". So,
>> fileSize would be 100%, but dataSize would be the actual used...
>> Is there a better approach?
>> Thanks.
>> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
Never mind, I just found an older message where Scott has written: "It
takes a read lock, and has to calculate some numbers from the extents; it
is not a very costly operation. "
So, I think I'll be running a cronjob script to get current data size...
Thanks!
On Tue, Jul 3, 2012 at 1:56 PM, Octavian Covalschi <
octavian.covals...@gmail.com> wrote:
> OK, looks like I need a different approach.
> Is db.stats() an expensive operation? Would it impact performance if I'll
> run it say, every 1min?
> Thanks!
> On Tue, Jul 3, 2012 at 1:37 PM, Kevin Matulef <matu...@10gen.com> wrote:
>> Unfortunately there's no built in flag to cap the total database size. As
>> you've discovered, the --quota option will limit the number of data files
>> and hence the total filesize. But figuring out the remaining space is a
>> little tricky, since some of the space in the datafiles is for indexes.
>> Also, if you're deleting documents, then fragmentation in the data files
>> might mean that not all of the remaining space is usable. fileSize minus
>> dataSize will give you a rough estimate of the remaining space, but it
>> won't be strictly accurate, so should be taken with a grain of salt. .
>> -Kevin
>> On Tuesday, July 3, 2012 1:54:36 PM UTC-4, oct wrote:
>>> Hi,
>>> Is %subj% even possible?
>>> Right now I'm limiting by using --quota and --quotaFiles, which works in
>>> a way, but I'm not sure how much space I've got left... is there a way to
>>> implement this? I need to make a small pie chart to display that.
>>> The only solution I'm thinking is to use db.stats() and "fileSize". So,
>>> fileSize would be 100%, but dataSize would be the actual used...
>>> Is there a better approach?
>>> Thanks.
>>> --
>> You received this message because you are subscribed to the Google
>> Groups "mongodb-user" group.
>> To post to this group, send email to mongodb-user@googlegroups.com
>> To unsubscribe from this group, send email to
>> mongodb-user+unsubscribe@googlegroups.com
>> See also the IRC channel -- freenode.net#mongodb