Skip to content

Database Usage

Nzyme stores everything it records in a single PostgreSQL database that is shared by all organizations and tenants. The database usage pages show how much of that database each subsystem and each data category occupies, how many rows that is, and let you purge data that you no longer need.

You can find the global view under System -> Database on the Usage tab of your Nzyme web interface. The same view exists for a single organization on the Database tab of its details page under System -> Authentication & Authorization, and for a single tenant on the Database tab of the tenant details page. Super administrators can open all three. Organization administrators can open the pages of their own organization and its tenants.

Usage per Subsystem

The first table on each usage page sums the data categories of every subsystem. It is the quickest way to see what is driving the growth of your database.

Subsystem Data categories
WiFi 802.11/WiFi, Timeline Events (802.11/WiFi)
Ethernet Ethernet: Layer 4, Ethernet: DNS, Ethernet: TLS Certificates, Portal Integrity Checks, Assets: Activity, Assets: Attributes, Assets: IP Addresses, Assets: Communication, Assets: Statistics, Assets: Identity, Segmentation: Flows, Segmentation: Findings
Bluetooth Bluetooth
UAV UAV

Usage per Data Category

The second table lists every data category with its size on disk, its row count and, on the tenant page, its retention time. On the global page, every category expands into one row per organization, and on the organization page into one row per tenant, so you can see which part of your installation holds the data.

Column Meaning
Data Category A group of tables that store the same kind of data. The categories are the same ones used for retention times and purging.
Data Size Space the tables of the category take up on disk, including their indexes and space that has not been reclaimed by vacuum yet.
Rows Rows in the tables of the category at the time of the last count.
Retention Time How long data is kept. Retention times are configured per tenant, so the global and organization pages show n/a. See Configuring Retention Times.
Purge Deletes all data of the category in the scope of the page.

How Nzyme Counts Rows

Counting the rows of a large table is expensive, so Nzyme never counts on page load. Instead, a background maintenance action counts all tables once per hour, after every purge, and when a user clicks Recalculate now at the bottom of the table. One node counts for the whole cluster and stores the result in the database, so every node and every page shows the same numbers. The line above the table tells you when the rows were last counted.

Until the first count has completed, for example right after an installation or an upgrade, the global row counts are estimates from the PostgreSQL planner statistics and are marked with a ≈ symbol. Organization and tenant rows show not counted yet until then, because the planner cannot estimate them.

A manual recalculation is refused if the rows were counted less than five minutes ago. If the last count failed, the error is shown above the table and the previous numbers remain in place.

Estimated Sizes

All tenants share the same tables, so the space that the data of one organization or tenant occupies on disk cannot be measured directly. Nzyme estimates it by splitting the size of every table by the share of rows that belong to the organization or tenant. These sizes are marked with a ≈ symbol. Row counts are always exact.

The estimate assumes that rows of the same table are about the same size. A tenant whose DNS queries carry unusually long names, or whose Layer 4 sessions have many more segments than average, takes up a little more space than the estimate shows.

Purging Data

The Purge link next to a category deletes all data of that category: everything on the global page, the data of one organization on the organization page, and the data of one tenant on the tenant page. The purge runs in the background and can take a while for large categories. It cannot be undone. The row counts are refreshed automatically once the purge is complete.

Purging is the right tool to get rid of data in one step, for example the data of a tenant that has been decommissioned. To keep the database at a steady size, configure retention times instead. Expired data is purged automatically once an hour.

Info

A purge marks rows as deleted but does not immediately shrink the tables on disk. PostgreSQL reclaims the space during the next vacuum and reuses it for new data. The Tables section of the Database Health & Maintenance page shows the dead rows that are waiting to be reclaimed.

Working With the Usage Pages

Start with the subsystem table. In most installations, Ethernet data grows fastest, because Layer 4 sessions and DNS queries are recorded for every connection on the network.

Compare the row count with the size when a category looks large. Layer 4 sessions are wide rows with several indexes, so a modest number of them can occupy a lot of space, while the DNS log consists of many small rows. If the size of a category grows faster than its row count, open the Tables section of the Database Health & Maintenance page: the index share of its tables or dead rows that have not been vacuumed yet are the usual reasons.

After you reduce a retention time, the next hourly purge removes the expired data and the rows are counted again afterwards. The size on disk follows once vacuum has reclaimed the space.