Docs

Data Retention

No commands or config file changes needed — NfSen's data retention is set from the GUI. Expire old data by age, cap it by disk size, or use both for a safe two-tier approach.

Set retention from the Web UI

  1. Log in to the Web UI (http://<YOUR_IP>:8070/).
  2. Click Profile Admin in the top menu.
  3. In the live profile row, click Edit.
  4. Set Expire (how long to keep data) and Max size (hard disk cap), then Save.

The nfsend daemon applies it automatically within a few minutes — no restart needed, and it covers every router.

Expire vs Max size

FieldWhat it doesExample
ExpireMax age of data to keep — deletes the oldest whole 5-minute files once they are older than this value.3d = keep 3 days
Max sizeMax disk size of the profile's flow data — deletes oldest files until under the cap.44G = never exceed 44 GB

Expire alone can still fill the disk on heavy traffic (it ignores file size). Max size guarantees it never does — on heavy traffic it just keeps less history. Setting both is the recommended approach. Only the oldest whole 5-minute files are ever removed; the file currently being written is never touched, and collection never stops.

Set retention from the command line

The GUI writes to the same per-profile config, so you can set it with one command instead — useful for scripting:

CommandEffect
nfsen --modify-profile live expire=30d maxsize=15G30 days of history, max 15 GB of flow data

NfSen 1.3.6p1 retention note

In this version, retention is a per-profile setting (the live profile). The global %expire / timelimit keys only exist in newer NfSen (1.3.7+). And $profiletimout in nfsen.conf is not retention — it is just the profile refresh timeout (default 60 s) and frees no disk space.

Storage planning

Raw flow files are the fastest-growing part of the stack. Watch disk usage after the first busy collection window and choose retention from observed volume. A good rule for a 20 GB disk: expire=30d maxsize=15G.