Unable to insert document - getting 8000, your are over your space quota

Hi there,

I am using a free cluster from mongodb altas. I have been using that for an year. Today I received an error when inserting document in the DB. But, I am able to retrieve the records from the DB. Please find the error message below.

“MongoServerError: you are over your space quota, using 512 MB of 512 MB”,

I deleted some of the collections and still getting the same error. Tried to run db.stats() for all the available DBs and the total size is 56 MB. Attached the response of the db.stats() queries below.


{
  db: 'test1',
  collections: 19,
  views: 1,
  objects: Long("195348"),
  avgObjSize: 2724.9829739746506,
  dataSize: Long("532319974"),
  storageSize: Long("55431168"),
  totalFreeStorageSize: Long("0"),
  numExtents: Long("0"),
  indexes: 25,
  indexSize: Long("962560"),
  indexFreeStorageSize: Long("0"),
  fileSize: Long("0"),
  nsSizeMB: 0,
  ok: 1
}
{
  db: 'test2',
  collections: 1,
  views: 0,
  objects: Long("0"),
  avgObjSize: 0,
  dataSize: Long("0"),
  storageSize: Long("4096"),
  totalFreeStorageSize: Long("0"),
  numExtents: Long("0"),
  indexes: 1,
  indexSize: Long("4096"),
  indexFreeStorageSize: Long("0"),
  fileSize: Long("0"),
  nsSizeMB: 0,
  ok: 1
}
{
  db: 'test3',
  collections: 11,
  views: 0,
  objects: Long("4113"),
  avgObjSize: 647.5229759299781,
  dataSize: Long("2663262"),
  storageSize: Long("2387968"),
  totalFreeStorageSize: Long("0"),
  numExtents: Long("0"),
  indexes: 22,
  indexSize: Long("1208320"),
  indexFreeStorageSize: Long("0"),
  fileSize: Long("0"),
  nsSizeMB: 0,
  ok: 1
}
{
  db: 'test4',
  collections: 2,
  views: 0,
  objects: Long("13"),
  avgObjSize: 6024.384615384615,
  dataSize: Long("78317"),
  storageSize: Long("53248"),
  totalFreeStorageSize: Long("0"),
  numExtents: Long("0"),
  indexes: 2,
  indexSize: Long("40960"),
  indexFreeStorageSize: Long("0"),
  fileSize: Long("0"),
  nsSizeMB: 0,
  ok: 1
}

Hi @Shelif_M_A,

Welcome to the community :wave:

The storage quotas for free and shared clusters are based on summing the dataSize and indexSize for all databases. You can refer to the documentation to learn - How does Atlas calculate storage limits for shared clusters (M0, M2, M5).

Based on the shared db.stats() output, it appears that the combined total of dataSize and indexSize exceeds 512 MB. This is the reason you are encountering the error message.

Please feel free to reach out in case of any further questions.

Regards,
Kushagra

MongoDB kept returning all kinds of 8000 errors when I got to 512MB/512MB. So I deleted a bunch of documents and things starting working again.

Same thing happening again, even though I believe I’m at 330MB AND i just upgraded to M2 with 2GB.

Here are my stats:

Database Statistics:
db: test
collections: 18
views: 0
objects: 19800
avgObjSize: 339.2477272727273
dataSize: 6717105
storageSize: 162074624
totalFreeStorageSize: 0
numExtents: 0
indexes: 31
indexSize: 324276224
indexFreeStorageSize: 0
fileSize: 0
nsSizeMB: 0
ok: 1

Any idea what’s going on?