fix: cgroupv1 mem limit + granular memory reporting (#4119)

* fix: cgroupv1 mem limit + granular memory reporting

* update ee ref

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
This commit is contained in:
HugoCasa
2024-07-23 16:24:22 +02:00
committed by GitHub
co-authored by Ruben Fiszel
parent ccf281c87a
commit 9e5c5873c8
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
7641d36277ffa75d816ed79d9b23eeae4f17f3a5
8e61cafa4ee95c60eb55e5ebeb07d7b1c2947eae
+2 -2
View File
@@ -186,9 +186,9 @@ pub fn get_vcpus() -> Option<i64> {
}
pub fn get_memory() -> Option<i64> {
if Path::new("/sys/fs/cgroup/memory/memory.max").exists() {
if Path::new("/sys/fs/cgroup/memory/memory.limit_in_bytes").exists() {
// cgroup v1
parse_file("/sys/fs/cgroup/memory/memory.max")
parse_file("/sys/fs/cgroup/memory/memory.limit_in_bytes")
} else {
// cgroup v2
let cgroup_path = get_cgroupv2_path()?;