Bug 1812096

Summary: Inconsistent data regarding cluster memory consumption
Product: OpenShift Container Platform Reporter: Pawel Krupa <pkrupa>
Component: Management ConsoleAssignee: Rastislav Wagner <rawagner>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4CC: aos-bugs, bpeterse, jokerman, yapei
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Utilization card and top consumers popover used different ways to calculate memory usage Consequence: Memory consumption data are not consistent Fix: Use the same queries for both utilization card and top consumer popover Result: Memory consumption data are consistent
Story Points: ---
Clone Of:
: 1815388 (view as bug list) Environment:
Last Closed: 2020-08-04 18:04:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1815388    

Description Pawel Krupa 2020-03-10 14:14:24 UTC
Description of problem:
Currently in the section "Cluster Utilisation" memory consumption is calculated using following query:

sum(node_memory_Active_bytes)

However, when using "by node" breakdown, the query used is:

`topk(25, sort_desc(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes))`.

Difference between queries causes differences in perceived memory usage.


Version-Release number of selected component (if applicable):
4.4


How reproducible:
always


Steps to Reproduce:
1. Start a cluster
2. Open Console

Actual results:
Cluster memory usage is calculated by taking only Active memory


Expected results:
Cluster memory consumption should be calculated by using `Total - Available` difference or with following query:

sum(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes)

Additional info:

This is probably also present in previous OpenShift versions, but I didn't verify it.

Possibly this line needs a change: https://github.com/openshift/console/blob/master/frontend/public/components/dashboard/dashboards-page/cluster-dashboard/queries.ts#L70

Comment 1 bpeterse 2020-03-10 14:44:33 UTC
*** Bug 1812098 has been marked as a duplicate of this bug. ***

Comment 2 bpeterse 2020-03-10 19:30:42 UTC
Targeting 4.5 as we are past code freeze.

Comment 5 Yadan Pei 2020-03-20 06:04:33 UTC
Now

Memory Utilization query is using query_range?start=1584679548.928&end=1584683148.928&step=60&query=sum(node_memory_MemTotal_bytes+-+node_memory_MemAvailable_bytes)
Memory Total query is using query?query=sum(node_memory_MemTotal_bytes)

Verified on 4.5.0-0.nightly-2020-03-19-112259

Comment 7 errata-xmlrpc 2020-08-04 18:04:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.5 image release advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:2409