Closed nuno-silva closed 4 years ago
@gjimenezf can you perhaps try increasing the memory usage on one of your servers and see if this happens to you?
Here's an example from another cacti instance:
At ~02:37 I allocated 20GB of RAM.
At ~02:48 I allocated 20 more GB of RAM.
At ~3:00 I started increasing the amount of buffers by reading a really big file. You can see it makes the graph go further above memTotalReal
, so it's clear that at least "buffers" are being stacked/summed twice in the graph: once by memBuffer
and then again in the (wrong) computation of usedReal
. Cache too, even though I did not test that.
At ~3:18, I reverted #6. After this, the graph starts to look more like the memory usage reported by htop (green is used, blue is buffers, yellow is cache, gray is free):
So does this mean #6 needs reverting?
Yes, at least partially. I would wait for @gjimenezf's input though. Maybe he's running some shiny new kernel or snmpd that changed way the values are reported and if that's the case more changes are needed.
We have had no feedback from @gjimenezf so, I guess its our call @nuno-silva?
Yes, please revert #6.
Both UCD-SNMP-MIB::memTotalReal.0
(.1.3.6.1.4.1.2021.4.5.0
) and HOST-RESOURCES-MIB::hrMemorySize.0
(.1.3.6.1.2.1.25.2.2.0
) OIDs give the same value on all my host, so I think you can keep using memTotalReal for consistency with the other ones and only revert the bad calculations.
I have now reverted c3feb030e865c3da1ec0f76bdf5b3f84d1a2a3ec so that 29a27a0 should show as expected. Unless you also want memCached deleting not adding? But that seems to be the bug with his change.
29a27a0 looks good. Thanks!
usedReal
is getting bigger thanmemTotalReal
, even with little swap usage:Reverting #6 seems to fix it, so there may be a problem with it:
Here's some example data from my RPi Zero device:
Note that the new OID for
totalReal
used in #6 gives me exactly the same result, so the issue must be in the new computation ofusedReal
:https://github.com/netniV/cacti-netsnmp-memory/blob/f00431317331ee3bb03a961b1050baca311f4716/scripts/ss_netsnmp_memory.php#L116-L117
Indeed,
(443 076 - (29188 - 42620 - 302084)) = 758592
, which is greater than my 443076 KB of RAM.Contrary to https://github.com/netniV/cacti-netsnmp-memory/pull/6#issue-385059158, my
availReal
is not the result of/proc/meminfo
MemAvailable + buffer + cache
: 29188 !=318788+42620+302084 = 663492
. Rather,memAvailReal
seems to be meminfo'sMemFree
, so the old computation seems just fine.