Settings → Database shows what the data takes and gives you the tools to tidy it. Netlens keeps two files: the main database (devices, events, scans, settings) and the graph store (measurements; it prunes itself: 7 days in full detail, 90 days at 5 minutes, 2 years per hour). The page shows both sizes, how much of the main file could be reclaimed, the free disk space and every table with its rows and size.
- How long data is kept: events (default 2 years), finished scans (1 year), presence checks (90 days), service check results (30 days) and the audit log (1 year). Events and scans used to grow for ever; 0 keeps them for ever.
- Remove old data (with a preview that only counts), Clean up leftovers (rows and graph series that belong to devices, checks or remote sites that no longer exist, found with a preview first), Optimize (refreshes the statistics the database uses), Rebuild indexes, Compact (VACUUM: gives freed space back to the disk; needs free space of about the size of the larger file, and writes wait for a moment) and Check integrity (both files, and rows that point at nothing).
- A weekly run (Sunday night) removes old data, cleans up leftovers, optimizes and checkpoints by itself; Run it now does the same on demand. Compacting stays a button of its own. Every action is in the audit log, and the page says when the weekly run last ran.
Only administrators see this page. Two indexes were added for the events table (by device and by kind), which makes removing a device or a site much faster on a database with many events.