-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[native] Add LinuxMemoryChecker check/warning to ensure system-mem-limit-gb is reasonably set #24149
base: master
Are you sure you want to change the base?
[native] Add LinuxMemoryChecker check/warning to ensure system-mem-limit-gb is reasonably set #24149
Conversation
4478ae1
to
15f55bb
Compare
15f55bb
to
7646600
Compare
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.
Can we add a test with fake files again just like we did with the original tests for this class?
That way we can try the "max" value for cgv2, and gigantic values and reasonable values. Basically testing the various situations we saw when investigating this.
8da401b
to
4ae2cee
Compare
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.
Thanks @minhancao, could you please squash the commits?
presto-native-execution/presto_cpp/main/tests/LinuxMemoryCheckerTest.cpp
Outdated
Show resolved
Hide resolved
85b3b9d
to
dab2335
Compare
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.
It is ideal if we can avoid checking in data files for testing.
We only need a few fields from the file for testing.
Can we write these required fields to a temporary file as part of the testing?
presto-native-execution/presto_cpp/main/tests/examples/cgroupV1memoryNotSet.limit_in_bytes
Outdated
Show resolved
Hide resolved
71c9fa9
to
89a50a8
Compare
89a50a8
to
163880b
Compare
presto-native-execution/presto_cpp/main/tests/LinuxMemoryCheckerTest.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/tests/LinuxMemoryCheckerTest.cpp
Outdated
Show resolved
Hide resolved
163880b
to
29dc3b5
Compare
9a7cbf7
to
80ca9b5
Compare
@czentgr @majetideepak @pramodsatya |
presto-native-execution/presto_cpp/main/tests/LinuxMemoryCheckerTest.cpp
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/tests/LinuxMemoryCheckerTest.cpp
Show resolved
Hide resolved
f25e5b1
to
b52384a
Compare
@majetideepak I have updated the PR with some new changes, please review when you can, thank you! |
presto-native-execution/presto_cpp/main/tests/LinuxMemoryCheckerTest.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/tests/LinuxMemoryCheckerTest.cpp
Outdated
Show resolved
Hide resolved
b52384a
to
9be902c
Compare
@czentgr @majetideepak Just updated the PR, please review when you can! |
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.
LGTM! (docs)
Pull branch, new doc build, looks good. Thanks!
Confirmed works on cgroup v1 machine:
Error - system-mem-limit-gb was higher than available machine memory of deployment:
|
Confirmed works on cgroup v2 machine:
Error - system-mem-limit-gb was higher than available machine memory of deployment:
|
9be902c
to
988ccf0
Compare
…mit-gb is reasonably set Add additional checks and warnings to ensure system-memory-gb <= system-mem-limit-gb < available machine memory of deployment. For cgroup v1: Set available machine memory of deployment to be the smaller number between /proc/meminfo and memory.limit_in_bytes. For cgroup v2: Set available machine memory of deployment to be the smaller number between /proc/meminfo and memory.max. If memory.max contains "max" string, then look at /proc/meminfo for the MemTotal, otherwise use the value in memory.max.
988ccf0
to
822c4e1
Compare
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.
Thanks, @minhancao
Description
Add additional checks and warnings to ensure
system-memory-gb <= system-mem-limit-gb < available machine memory of deployment.
For cgroup v1:
Set available machine memory of deployment to be the smaller number
between /proc/meminfo and memory.limit_in_bytes.
For cgroup v2:
Set available machine memory of deployment to be the smaller number
between /proc/meminfo and memory.max.
If memory.max contains "max" string, then look at
/proc/meminfo for the MemTotal, otherwise use the
value in memory.max.
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.