netsec(collector): gzip on rotate so 960 MiB holds ~72-100 h of flows #71
Loading…
Reference in a new issue
No description provided.
Delete branch "wt/t_cfea18ac-gzip-rotate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Rotate-time gzip for
netsec/hubble-flow-collector. No record-schema change, no filter change, no DaemonSet argument change (the DS diff is two comment lines;MAX_FILE_BYTES/MAX_FILES/MAX_TOTAL_BYTESvalues are untouched).flows-<ts>-<n>.jsonl.jsonl.gzvia temp name + atomic rename, in the background (never stalls the flow reader).gz.tmp) at 960 MiB, oldest first, and never reaps the live file or a file whose gzip is runningMAX_FILESnow bounds plain files onlyWhy
The cap was fine; the retention was not. Measured 2026-11-27 on siriussec: 3.38-4.28 MB/min (4.5-6.2 GB/day) of filtered JSONL, i.e. ~4-5 h inside 960 MiB. Real-data ratio is 18.53x at gzip -9 (17.85x at -6):
Verification (offline, before merge)
hubble: 13 rotations -> 13 archives, every archivegzip -tclean, every line complete JSON with theflow.*shape and newline-terminated, live file plain, dir under cap, oldest-first prune, live-file and in-flight protection proven by removing the marker and watching the same file get reapedgzip -tOK, no plain-without-archive left behindfilter.awkuntouched; sensor (sirius/netsec-agent) globs*.jsonland already forgets rotated-away files, so it keeps reading; worst case it loses the tail written since its last 5-minute tick in the file that rotates