Use hard memory limit for EVE memory management. #4300
Merged
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.
Previously, EVE referenced the soft memory limit
(
memory.soft_limit_in_bytes
) to determine available memory for VM creation. By default, the soft and hard memory limits were set to the same value, so this did not cause any issues. However, if the soft and hard limits are configured differently, EVE would not respect the hard memory constraints, allowing VMs to be created without adhering to the intended maximum memory limits.This commit updates the
EveMemoryLimitFile
path to use the hard memory limit (memory.limit_in_bytes
) instead of the soft limit. By doing so, EVE will now properly account for the hard memory restrictions when managing memory for containers and creating new VMs, preventing potential memory overcommitment when soft and hard limits differ.Thanks, @cperakis, for performing the test, which helped uncover it.