Skip to content
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

Relax check_panel_memory actor's check #81

Open
wants to merge 1 commit into
base: almalinux-legacy
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@
CPANEL_NAME: 2048 * 1024, # 2 Gb
}

# The kernel subtracts memory pages used for its own overhead from the total
# memory reported to userspace. The subtracted amount varies depending on a
# variety of factors, but based on a few samples, it seems to use somewhere
# between 50-75 MiB on a 2 GiB machine, not counting memory reserved for the
# crash kernel. Allow for a little more than this to be missing from the total
# before this check is considered a failure.
ALLOWABLE_OVERHEAD = 96 * 1024 # 96 MiB


def _check_memory(panel, mem_info):
msg = {}

min_req = required_memory[panel]
is_ok = mem_info.mem_total >= min_req
is_ok = mem_info.mem_total >= min_req - ALLOWABLE_OVERHEAD
msg = {} if is_ok else {"detected": mem_info.mem_total, "minimal_req": min_req}

return msg
Expand Down