Dashboard - Memory usage 0%

  • Hi,


    Why is in Dashboard still memory usage on 0%?



    Code
    root@NAS:~# top
    top - 20:09:03 up 56 min,  1 user,  load average: 0,04, 1,20, 1,07
    Tasks: 135 total,   1 running, 134 sleeping,   0 stopped,   0 zombie
    %Cpu(s):  0,3 us,  0,3 sy,  0,0 ni, 99,2 id,  0,2 wa,  0,0 hi,  0,0 si,  0,0 st
    KiB Mem :  8066564 total,  2689656 free,   154992 used,  5221916 buff/cache
    KiB Swap:  3963900 total,  3963900 free,        0 used.  7637824 avail Mem
  • Re,


    because "154992 used" Bytes divided through "8066564 total" Bytes is equal 0,01921412884097863724877159593601 % ... or 0,02% (even zero).



    "5221916 buff/cache" Bytes are not counted in the "memory usage" ... so far.



    Sc0rp



    :D

  • Re,


    Cached things are not counted in this "Memory usage" things, for more info use either cli (cat /proc/meminfo or htop), or use the sensor-plugin (afaik this one greps mem-statistics too, but i can be wrong).


    CIFS use only little space for tables itself, files will be "cached". What Plex uses on real RAM i don't know ...


    Btw. you doesn't provide any details from your RAM, or any other statistics from your build ...


    Sc0rp

  • because "154992 used" Bytes divided through "8066564 total" Bytes is equal 0,01921412884097863724877159593601 % ... or 0,02% (even zero).

    No, since 154992 / 8066564 = 0.01921412884097863724877159593601 --> 1.9% or ~2% (just as 50 / 100 = 0.5 -->50%)


    I get on an OMV toy (Raspberry Pi 3) 10% memory usage reported when it looks like this:


    Code
    root@raspberrypi:~# free -k
                 total       used       free     shared    buffers     cached
    Mem:       1000304     414956     585348      55420      20708     297808
    -/+ buffers/cache:      96440     903864
    Swap:       631212          0     631212


    So I would assume it's 96440 / 1000304 we're talking here about (9.6% --> 10%)


    @henkall can you please provide 'free -k' output? And from the following (just curious):


    Code
    mem_info=$(LANG=en_US.UTF-8 free -w 2>/dev/null | grep "^Mem" || LANG=en_US.UTF-8 free | grep "^Mem")
    awk '{printf("%.0f",(($2-($4+$6+$7))/$2) * 100)}' <<<${mem_info}
  • free -k

    Thanks for this though I asked for the output from two commands. Anyway, wasted some time to test myself and IMO it's obvious that the 'Memory usage' display in the web Ui is broken with OMV 4 (Stretch).


    If I understand correctly currently the function to display this uses 'free -b' output, relies on the '-/+ buffers/cache' line simply dividing both values and constructing the percentage. Works fine in Jessie (same with Armbian's function):

    Code
    root@raspberrypi:~# free -b
                 total       used       free     shared    buffers     cached
    Mem:    1024311296  426393600  597917696   63684608   21786624  312111104
    -/+ buffers/cache:   92495872  931815424
    Swap:    646361088          0  646361088
    root@raspberrypi:~# echo $(( 100 * 92495872 / 931815424 ))
    9
    root@raspberrypi:~# mem_info=$(LANG=en_US.UTF-8 free -w 2>/dev/null | grep "^Mem" || LANG=en_US.UTF-8 free | grep "^Mem")
    root@raspberrypi:~# awk '{printf("%.0f",(($2-($4+$6+$7))/$2) * 100)}' <<<${mem_info}
    9

    With Stretch 'free -b' output looks different (the whole '-/+ buffers/cache' line missing) so there's always 0% displayed while the function Armbian uses still works:

    Code
    root@raspberrypi:~# lsb_release -cs
    stretch
    root@raspberrypi:~# free -b
                  total        used        free      shared  buff/cache   available
    Mem:     1024311296    74780672   594886656    44621824   354643968   888623104
    Swap:     646361088           0   646361088
    root@raspberrypi:~# mem_info=$(LANG=en_US.UTF-8 free -w 2>/dev/null | grep "^Mem" || LANG=en_US.UTF-8 free | grep "^Mem")
    root@raspberrypi:~# awk '{printf("%.0f",(($2-($4+$6+$7))/$2) * 100)}' <<<${mem_info}
    7

    Meanwhile in the UI:


    So anyone concerned about this should look whether it's already reported in the bugtracker and if not create a ticket for this.

    • Official Post

    omv 8.5.8-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.2 | compose 8.1.24 | cterm 8.0.2 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.2 | scripts 8.0.6 | writecache 8.2.4 | backup 8.1 | kernel 8.0.16


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    A patch would be fine too. I can’t do everything myself.

    I'll look at it in a bit.

    omv 8.5.8-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.2 | compose 8.1.24 | cterm 8.0.2 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.2 | scripts 8.0.6 | writecache 8.2.4 | backup 8.1 | kernel 8.0.16


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I'll look at it in a bit

    Since I'm still a bit new to OMV just a quick note on the above 'Armbian code'. We ran into the problem already last year when starting to support Ubuntu Xenial (more recent procps package than Jessie back then) so all I can tell is that it works as above and that the inelegant


    Code
    free -w || free


    hack is needed to produce same results on all our currently supported Debian variants/derivates -- parsing /proc/memory is at least on ARM too dependent on kernel version so I stopped looking into it

  • Made the changes and everything runs like expected. Thanks for fixing @votdev

    OMV-Server-HW: MoBo Fujitsu D3417-B2 (Intel-LAN), Intel Xeon E3-1245 v6 Kaby Lake (4x3.70GHz), 16GB-Ram ECC UDIMM, 1x512GB SSD Samsung 850 Pro (sda2 - 30GB system, 4GB swap, sda5/rest - for work), 1x 10TB WD Red Pro, 1x 3TB WD Red (both basic setup) - Digibit R1 Sat-IP-Server with SatIP-Axe-Firmware


    OMV-Server-SW: in preparation for OMV7

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!