Nightscout Issues

The free Nightscout we use also depends on a free database from mLab. The free database only has so much room...500 MB to be specific. After a period of time (it will vary, but usually on the order of months), your mLab database could reach its free limits. When that happens, your NS site may stop showing data properly. For example, you may notice your Share Bridge will not pull data and your site will be “stale”.

The good news? Loop can still run just fine until you cleanout and/or compact your mLab database. The bad news? You just won’t be able to remotely monitor Loop through NS until you clear up some storage space in mLab.

Note there are two areas where the 500 MB data limit can be an issue. One is called the size which is the actual data stored in your database. The other is called size on disk which is the virtual space that your database takes up. As data is written onto your free database, sometimes it is written inefficiently and virtually "spreads out" to take up more room. Depending on where your issue is, you may need to delete or cleanout data (if size is the issue) or you may just need to compact data (if size on disk is the issue). To see the two areas, as shown on the screenshot below, click on the small Home link button as shown.

Cleanout mLab

If size is the issue, there are two ways to cleanout space and delete data in your mLab database:

mLab Direct Access

Nightscout Admin Tools

If you go to your Nightscout site's settings (the three horizontal bars in the upper right of your Nightscout site), you will be able to access your Admin Tools for the site. These include some useful quick mLab actions, includig deleting documents from the devicestatus collection similar to the action we took in the steps above. But, it's worth noting that if you have errant future data in your Nightscout site that is causing problems (usually during time changes or overseas travel), you can clean-out future entries through this portal, too.

Compact mLab

You may get an email from mLab, even after cleaning out enough space in your database, alerting you that your "file size limit" may have been exceeded. However, these emails aren't always sent and sometimes you'll need to compact your mLab even without being notified.

To begin the compaction process, click on your database name.

Then click on the Tools tab in the screen that opens. Click on the commands button and then select the repairDatabase from the dropdown menu of available commands. At the bottom of the screen, select the Run Command button.

Unfortunately, the repairDatabase command really is glitchy. Most of the time, the command will simply stall out and not actually produce a successful ok return message. If you are having problems with the command actually running, try deleting the documents in the devicestatus collection, as described in the section above. After cleaning out the devicestatus collection, the repairDatabase command should work just fine.

Return to your home screen and you will be able to verify the Size on Disk has decreased.