I have been using mongodb recently, and I have found out that it is taking a lot of space.
For example, in its db directory /var/lib/mongodb/, if I type “du -sh”, then result turns out to be 417M. The thing is that there are only few entries in database, and I do not know how that can take up to 400M of space. Is it normal? or have I done something wrong?
Databases typically expand space automatically but do not return it when no longer needed. This can happen during tests or running queries. Similarly if you have indexes or created aggregates with map-reduce they need to go somewhere next to “your” data.
Special tools must be run manually to reclaim the space. Checkout the repair database functionality.
Run it and see how many is still used after cleaning.