-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Enabled MADV_DONTNEED in systemd and docker files #22786
Comments
Pinging @elastic/integrations-services (Team:Services) |
@urso The systemd unit files are pretty straight forward, and I assume we'll just want to add an
|
Yes
This looks like a beat wrapper script for CLI use. Is it The wrapper is ignored by the init file and by the systemd unit file. Modifying it will only affect users running Beats on command line, or those having custom scripts running the wrapper for whatever reason. Yet we should apply the change to the wraper as well. In the wrapper ensure that we do not overwrite GODEBUG if it is already set. You find the debian init files in dev-tools/packaging/templates/deb/. The ones for the RPMs in dev-tools/packaging/templates/rpm/. The init scripts are normal shell scripts that spawn sub-processes. In each script it is just a matter of adding |
Linked PR. Not sure how to test this beyond "the env var is in the build" |
Merged, with backported changes. Closing this now. |
@fearful-symmetry I reopened the issue. The task "Add a note about this in known issues for 7.x maintained versions." seems to be missing. Please add a "known issue" to our docs. The oldest affected version is 7.2 I think. |
@fearful-symmetry Did we finish all tasks? Can we close the issue? |
Yep. |
The go runtime defaults to MADV_FREE by default. In that case pages are still assigned with the Beat, even after the pages have been "returned" to the OS. The kernel will eventually claim these pages, but RSS memory usage is reported as very high (which it is not necessarily). This seems to mess with the OOM killer at times.
As workaround one can tell the runtime to use MADV_DONTNEED via
GODEBUG="madvdontneed=1"
. We should introduce this environment variable to the systemd file, init file, and docker file by default.What to do
GODEBUG="madvdontneed=1"
to docker images.GODEBUG="madvdontneed=1"
to systemd unit file.GODEBUG="madvdontneed=1"
to init file.More information
madvdontneed=1
will be the default in Go 1.16 https://go-review.googlesource.com/c/go/+/267100/The text was updated successfully, but these errors were encountered: