From 0464889edcf068f552ddcc68a8e8c9c067565c77 Mon Sep 17 00:00:00 2001 From: Brian Chau Date: Tue, 9 Aug 2022 14:09:14 -0700 Subject: [PATCH 1/2] cli: for systems with cgroups v2, fix alloation resource utilization showing 0 memory used --- command/node_status.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/command/node_status.go b/command/node_status.go index a58c594e4..bb6702125 100644 --- a/command/node_status.go +++ b/command/node_status.go @@ -964,7 +964,11 @@ func getActualResources(client *api.Client, runningAllocs []*api.Allocation, nod } cpu += stats.ResourceUsage.CpuStats.TotalTicks - mem += stats.ResourceUsage.MemoryStats.RSS + if stats.ResourceUsage.MemoryStats.Usage > 0 { + mem += stats.ResourceUsage.MemoryStats.Usage + } else { + mem += stats.ResourceUsage.MemoryStats.RSS + } } resources := make([]string, 2) From c0626dab35d83a6273c591cc1e0840d02ee43e80 Mon Sep 17 00:00:00 2001 From: Brian Chau Date: Tue, 9 Aug 2022 14:16:34 -0700 Subject: [PATCH 2/2] Add changelog 14069 --- .changelog/14069.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/14069.txt diff --git a/.changelog/14069.txt b/.changelog/14069.txt new file mode 100644 index 000000000..9076fc3d6 --- /dev/null +++ b/.changelog/14069.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: Fixed a bug where the memory usage reported by Allocation Resource Utilization is zero on systems using cgroups v2 +```