You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if program running in a docker container with cgroup limits, the way to get CPU/Memory limits is not accuracy which potentially will cause OOM
Solution
Get Memory Limit
try get memory limit from /sys/fs/cgroup/memory/memory.limit_in_bytes, if the value is 0 or large than /proc/meminfo, fallback to use the mem info inside /proc/meminfo
Get CPU Limit
try to caculate CPU Core number from /sys/fs/cgroup/cpu/cpu.cfs_quota_us Div /sys/fs/cgroup/cpu/cpu.cfs_period_us, if it's not a valid number, then fallback to omp_get_num_procs()
Context
zkevm-prover/src/utils/utils.cpp
Line 61 in 94f5662
zkevm-prover/src/utils/utils.cpp
Line 425 in 94f5662
Problems
if program running in a docker container with cgroup limits, the way to get CPU/Memory limits is not accuracy which potentially will cause OOM
Solution
Get Memory Limit
try get memory limit from
/sys/fs/cgroup/memory/memory.limit_in_bytes
, if the value is 0 or large than/proc/meminfo
, fallback to use the mem info inside/proc/meminfo
Get CPU Limit
try to caculate CPU Core number from
/sys/fs/cgroup/cpu/cpu.cfs_quota_us
Div/sys/fs/cgroup/cpu/cpu.cfs_period_us
, if it's not a valid number, then fallback toomp_get_num_procs()
Refs
The text was updated successfully, but these errors were encountered: