My 20GB DigitalOcean is consume 15.75GB of 19.56GB already! Note that I just finish setup Parse Server and only have 1 user record in MongoDB for testing which really mean 1 droplets never enough for real production.
But before we scale to another droplets, Maybe some cleanup could gain some space if we get lucky? Let’s try!
We’ll need some measuring tools. And after googling, I choose ncdu
# apt-get install ncdu
Run ncdu at “/”
# ncdu /
Clean up unused Docker.
Let’s try first approach, some random script from googling.
And run (or DRY first) at your own risk.
# . docker-cleanup
Not bad! We just save 1.3GB
Refer to this guide we’ve to…
Remove partial packages from the system.
# sudo apt-get autoclean
Remove .deb packages that apt caches when you install/update programs.
# sudo apt-get clean
Remove packages installed as dependencies after the original package is removed from the system.
# sudo apt-get autoremove
And run ncdu at “/” again.
# ncdu /
And now we got 13.6GB (from 15.4GB)which when we get around ~1.8GB back! Weeee!
We not done yet! after googling I found some more command to try…
# docker volume rm $(docker volume ls -qf dangling=true)
Wow dangling! as you can see we just clean up 5.4GB of junk! Woooot!
Phewww! This trick save my space which mean $$$ on DigitalOcean! (Sorry Digital Ocean’s team. I’ll paid you more for scaling but I’m not willing to paid for store 5.4GB of junk!) Now I can continue my Parse Server’s journey with more clean container :)