Skip to content

Reduce minimum nfcapd time to 1 second#664

Closed
MuriloChianfa wants to merge 1 commit into
phaag:masterfrom
MuriloChianfa:reduce-minimum-collection-time-interval-to-1-second
Closed

Reduce minimum nfcapd time to 1 second#664
MuriloChianfa wants to merge 1 commit into
phaag:masterfrom
MuriloChianfa:reduce-minimum-collection-time-interval-to-1-second

Conversation

@MuriloChianfa

Copy link
Copy Markdown
Contributor

Hey @phaag,

I'm trying to reduce to 1 second the nfcapd rotation time and so far it looks good, there is any reason that I should be aware on why you restricted into 2 seconds? or else we could reduce it, maybe into sub-seconds later. 👀👀

Tests Made

NetFlow v9 exporter exporting to port 2055, then an samplicator listening and replaying to two different nfcapd:

docker run -d --name samplicator --network host elastiflow/samplicator:1.0.1_1.3.8rc1 -s 0.0.0.0 -p 2055 127.0.0.1/9000 127.0.0.1/9001

Now, one baseline nfcapd listening using -t 2:

/usr/local/bin/nfcapd -p 9001 -w /tmp/test-2sec -I baseline -t 2 -D

And the new version using -t 1:

./src/nfcapd/nfcapd -p 9000 -w /tmp/test-1sec -I new -t 1 -D

After some time, they both captured the same traffic:

[murilo@workstation: nfdump]$ nfdump -R /tmp/test-1sec -A router
Date first seen         Duration                 Router IP   Packets    Bytes      bps    Bpp Flows
2026-01-30 22:11:47.000     00:01:29.000         127.0.0.1     38622   36.7 M    3.3 M    950 10307
Summary: total flows: 10307, total bytes: 36.7 M, total packets: 38622, avg bps: 3.3 M, avg pps: 433, avg bpp: 950
Time window: 2026-01-30 22:11:47.000 - 2026-01-30 22:13:16.000, Duration:    00:01:29.000
Total records processed: 10307, passed: 10307, Blocks skipped: 0, Bytes read: 2180628
Sys: 0.0638s User: 0.1913s Wall: 0.0015s flows/second: 7002055.6 Runtime: 0.0015s
[murilo@workstation: nfdump]$ 
[murilo@workstation: nfdump]$ nfdump -R /tmp/test-2sec -A router
Date first seen         Duration                 Router IP   Packets    Bytes      bps    Bpp Flows
2026-01-30 22:11:47.000     00:01:29.000         127.0.0.1     38622   36.7 M    3.3 M    950 10307
Summary: total flows: 10307, total bytes: 36.7 M, total packets: 38622, avg bps: 3.3 M, avg pps: 433, avg bpp: 950
Time window: 2026-01-30 22:11:47.000 - 2026-01-30 22:13:16.000, Duration:    00:01:29.000
Total records processed: 10307, passed: 10307, Blocks skipped: 0, Bytes read: 2178708
Sys: 0.0636s User: 0.1888s Wall: 0.0012s flows/second: 8909870.4 Runtime: 0.0012s

Note

They both had 10307 flows


This test was made only using NetFlow v9. Further tests may be needed with sflow on sfcapd and raw packets in nfpcapd. Let me know you thoughts about. Thanks.

@phaag phaag closed this in 1499834 Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant