-
Notifications
You must be signed in to change notification settings - Fork 1
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
Flag -maxheap #46
Flag -maxheap #46
Conversation
Pull Request Test Coverage Report for Build 24
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r2, all commit messages.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @stephen-soltesz)
demuxer/tcp.go
line 67 at r2 (raw file):
ms := runtime.MemStats{} runtime.ReadMemStats(&ms) // log.Println(ms.HeapAlloc, ">", maxHeap, "==", ms.HeapAlloc > maxHeap)
Nit: commented LOC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @robertodauria)
demuxer/tcp.go
line 67 at r2 (raw file):
Previously, robertodauria (Roberto D'Auria) wrote…
Nit: commented LOC
Thank you.
This change adds a new flag (
-maxheap
) to packet-headers that limits the total RAM used by the process. This change requires a new feature of go1.19debug.SetMemoryLimit
.From local testing, in response to a SYN flood event:
SetMemoryLimit
alone is not sufficient to prevent eventual RAM exhaustion. New savers are created faster than the timeout and GC removes them.saver.StartNew
alone is not sufficient to prevent RAM exhaustion either because the GC does not activate frequently enough.Shorter settings for
-uuidwaittimeout
(down to 100ms) had no effect on the eventual RAM exhaustion.When total RAM used is greater than
maxHeap
, new streams will be ignored. In effect, this both limits new memory allocations and may prevent some legitimate traces from ever being collected, or collected incompletely.Collection will resume after adequate RAM is available. The setting for
-maxheap
should be greater or equal to-maxidleram
.Resolves:
This change is