Netlens keeps everything in one database file and is meant for homes, offices and a handful of sites. This page says how it behaves when the network gets big, with measured numbers, and where the limits are.
How we measured
The tool tools/bench.py in the project builds a made-up network of any size: devices with ports and names, a hierarchy, groups, an event history, an uptime history with a check every 5 minutes, and health readings for one device in twenty. It then times what a person waits for, inside the application, without the network. Run it yourself with python tools/bench.py --devices 2000 --days 7.
The numbers are the first request after nothing was cached, on a fast desktop processor with an SSD. A small ARM board or a NAS will be several times slower. Pages are cached for 30 seconds and answer in a few milliseconds after that, and an answer up to two minutes old is shown at once while a fresh one is made in the background.
| What you open | 500 devices | 2,000 devices | 10,000 devices |
|---|---|---|---|
| Device list | 25 ms | 46 ms | 166 ms |
| Map | 18 ms | 47 ms | 211 ms |
| Hierarchy | 87 ms | 88 ms | 189 ms |
| Dashboard | 242 ms | 776 ms | 3.1 s |
| Uptime page, 24 hours | 234 ms | 907 ms | 4.0 s |
| Uptime page, 30 days | 583 ms | 2.4 s | 5.3 s |
| Statistics | 371 ms | 1.2 s | 4.3 s |
| Summary for Home Assistant | 173 ms | 655 ms | 2.8 s |
| Prometheus metrics | 327 ms | 1.1 s | 4.5 s |
| Monthly availability report | 548 ms | 2.2 s | 4.7 s |
| Weekly report | 535 ms | 2.2 s | 4.9 s |
| Saving a scan that finds every device | 93 ms | 474 ms | 5.9 s |
| Start of the application | 109 ms | 387 ms | 1.8 s |
| Database files | 118 MB | 475 MB | 1.0 GB |
| Uptime history in them | 1.0 million checks (7 days) | 4.0 million checks (7 days) | 8.6 million checks (3 days) |
What keeps it quick
- An hourly roll-up of the uptime history. Availability over a week or a month used to add up every check ever made. Netlens now also keeps, per device and hour, how many checks there were and how many were up, so the same exact answer comes from thousands of rows instead of millions. It is kept up to date as checks are written and built in the background after an update.
- Reports read only what failed. The monthly report looks up the checks of an hour only when a check failed in it.
- Counting inside the database. Flapping and outage counts are worked out by SQLite, not by looping over rows.
- Saving a scan in steps. A scan commits every 250 devices instead of for every device, which is about four times faster on a big network.
- One pass for the hierarchy. The number of devices below each device is counted in one pass instead of one search per device (11 seconds became 0.2 seconds at 10,000 devices).
Where the limits are
The uptime history grows with devices times checks. A check every 5 minutes for 90 days is about 26,000 rows per device, so 10,000 devices means a database of several gigabytes. As a rule of thumb Netlens is comfortable up to about 2,000 devices on modest hardware and about 5,000 on a fast machine with an SSD. The Uptime page sends every device with its bars to the browser, so it is the heaviest page on a very large network.
Beyond that, an external database for larger installations is planned. It is on the roadmap.