Skip to content

Instantly share code, notes, and snippets.

View substars's full-sized avatar

Benjamin Ortega substars

  • Team MEAT MANE
  • Minneapolis, MN
View GitHub Profile
@jyaw
jyaw / nightscout-mlab-maintenance-backup-and-reduce-size.md
Last active April 25, 2019 11:24
Nightscout mLab Maintenance, Backup and Reduce

#Nightscout mLab Maintenance ###How to backup and reduce the size of your mLab sandbox

This gist documents the method I use to maintain the size of my MongoDB collections used with my Nightscout instance. I've noticed that I occasionally run out of space on my sandbox mLab account (the devicestatus collection is typically the culprit). This may be due to the use of multiple rigs at once... not sure exactly. If you have a sandbox mLab account you're capped at 496 MB, preallocated to contain the aggregate of storageSize and indexSize and some magical margin of MBs 😄. You can find those sizes on the mLab site under Stats. When my devicestatus collection gets too large, the smaller collections tend to keep functioning but the devicestatus quits updating. Currently, with heroku mLab, I don't get any notification that I'm running out of space, so I have to keep checking in on it.

These instructions were completed with a Windows 10 laptop. Much of it will be similar for other systems (including approach an