-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
output/eve: reduce fflush call count #12527
Open
jlucovsky
wants to merge
7
commits into
OISF:master
Choose a base branch
from
jlucovsky:3449.v4/7
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+655
−92
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Issue: 3449 Add a flush function to packet logger registration and collapse the parameter count for registration functions.
This commit adds 2 EVE output buffering settings - buffer-size value which specifies the amount of buffering, if any, for regular/file output types. - flush-interval Specifies the cadence at which Suricata will direct detect threads to flush EVE output. Issue: 3449
Issue: 3449
Issue: 3449 Add flushing functions and infrastructure. This includes: - Flushing functions for packet loggers - Log file flushing support
Issue: 3449 Add a flush directive to the packet that is distinct from the existing "log flush" flag as the new flag is to distinguish between the 2 use cases.
Issue: 3449
jlucovsky
requested review from
jufajardini,
victorjulien and
a team
as code owners
February 3, 2025 16:07
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12527 +/- ##
==========================================
- Coverage 80.68% 80.66% -0.03%
==========================================
Files 925 926 +1
Lines 258914 259178 +264
==========================================
+ Hits 208914 209071 +157
- Misses 50000 50107 +107
Flags with carried forward coverage won't be shown. Click here to find out more. |
WARNING:
Pipeline 24556 |
jasonish
reviewed
Feb 3, 2025
I'm running this live now with a log ingestor. So far so good but its only been about an hour, but the implementation seems sane. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continuation of #12525
Reduce fflush calls on output streams (regular files only).
Output can be buffered, specify the buffer-size with
outputs.<type>.buffer-size
. A value of 0 selects no buffering; otherwise, up to the buffer-size value can be buffered. Note that this buffering is part of the stdio library.Since output can be buffered, a mechanism that periodically flushes the output streams has been added. The
heartbeat.output-flush-interval
configuration setting specifies at what interval the output should be flushed. A value of 0 means never flush.Link to redmine ticket: 3449
Describe changes:
buffer-size
. When 0, unbuffered I/O is used; other values are used to set the stdio buffer size. The value isoutputs.eve-log.buffer-size
heartbeat.output-flush-interval
-- to set cadence for Suricata periodically directing detect threads to flush EVE output. To be used in conjunction withbuffer-size
. Setheartbeat.output-flush-interval
to the number of seconds Suricata should periodically cause the EVE output to be flushed. The default value is0
which instructs Suricata never to cause the EVE output to be flushed.heartbeat.output-flush-interval
heartbeat.output-flush-interval
is between 1 and 60 in seconds).Updates:
Suricata build information
Benchmarks/Measurements
Hyperfine was used to measure results with my pcap collection and ET Pro
Summary: Buffering had the biggest impact; using the flushing mechanism had little effect but is necessary for integrity.
Recommendation:
Adding buffering in any amount improves performance. When buffering, a flush interval of 30 seconds is recommented
eve-log.buffer-size: 64kb
heartbeat.output-flush-interval: 30
(seconds)Permutations benchmarked for
buffer-size
andoutput-flush-interval
Hyperfine output