Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongolab "quota exceeded" although I barely hit half my maximum allowed size

I'm running a Sandbox database for an amateur project for a contest. Its the first time I do this, and I made the mistake of waiting until everything was done before uploading to my database all the records I will analyze via MapReduce operations.

The problem: I think I might have fucked something up, because I got it all figured, but when I barely hit half my maximum allowed size (which is 500MB, and I have a 320MB collection and a 7KB one), I started getting "Quota Exceeded" errors, code 12501. What is this?

Please help me, this is due tomorrow

Stats: http://i.imgur.com/r58nIgg.png fileSize seems to be almost 500MB, but it has been that way for a while and it still uploaded, I figured that was some kind of allocated space. How does it make sense that I cant use the whole disk space they claim to offer for free?

like image 745
CyborgFish Avatar asked Oct 20 '22 14:10

CyborgFish


1 Answers

MongoDB preallocates data files and may preallocate journal files. You can reduce this space by disabling journal files, although this is not recommended on production systems.

You can reduce your database file size by running the compact command:

db.runCommand ( { compact: '<collection>' } )

You can disable the journal files as follow:

In the MongoDB configuration file add the following line:

smallfiles=true

Then shut down MongoDB and remove the journal files using the following steps:

sudo cp -p /etc/mongodb.conf /etc/mongodb.conf.orig
sudo vi /etc/mongodb.conf
sudo service mongodb stop
sudo rm -rf /var/lib/mongodb/journal/*
sudo service mongodb start

All the files in /var/lib/mongodb/journal/ are recreated when mongodb starts.

like image 92
Alex Avatar answered Oct 22 '22 11:10

Alex