Why is OMV now using swap? No swap partition is there

  • Hi.


    My OMV 4.x is now using swap eventhough i have alot of free memory available.
    Why is it using swap. I dont recall i had any swap usage before.


    My fstab does not contain swap partition.


    Output: cat /etc/fstab

    Code
    UUID=4353d1a10-2189-4669-a8f0-96d3c0ea1504 / btrfs defaults,noatime,nodiratime,commit=600,compress=lzo 0 1                                                                                         
    UUID=87661a22d-5ea3-4f8a-a9de-c95fceb237e6 /boot ext4 defaults,commit=600,errors=remount-ro 0 2                                                                                                    
    # >>> [openmediavault]                                                                                                                                                                            
    /dev/disk/by-id/mmc-SC16G_0xd4324bc9-part3 /srv/dev-disk-by-id-mmc-SC16G_0xf1e24bc9-part3 btrfs defaults,nofail,discard,ssd 0 2                                                                   
    /dev/disk/by-label/5TB /srv/dev-disk-by-label-5TB ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2                                         
    /dev/disk/by-label/1TB /srv/dev-disk-by-label-1TB ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2                                         
    /srv/dev-disk-by-label-5TB/ /export/5TB none bind,nofail 0 0                                                                                                                                      
    # <<< [openmediavault]                                                                                                                                                                            
    tmpfs           /tmp            tmpfs   defaults        0       0




    Output: cat /proc/swap

    Code
    Filename                                Type            Size    Used    Priority                                                                                                                  
    /dev/zram0                              partition       127800  5376    5                                                                                                                         
    /dev/zram1                              partition       127800  5120    5                                                                                                                         
    /dev/zram2                              partition       127800  5120    5                                                                                                                         
    /dev/zram3                              partition       127800  5120    5                                                                                                                         
    /dev/zram4                              partition       127800  5120    5                                                                                                                         
    /dev/zram5                              partition       127800  5120    5                                                                                                                         
    /dev/zram6                              partition       127800  5120    5                                                                                                                         
    /dev/zram7                              partition       127800  5120    5


    Output: free -h

    Code
    total        used        free      shared  buff/cache   available                                                                                                                   
    Mem:           2.0G        566M        166M        311M        1.2G        1.0G                                                                                                                   
    Swap:          998M         40M        958M


    I have considered if it is the flashmemory plugin (folder2ram) which is using the swap partition.
    However if i copy a 50MB file to /var/log, the swap usage doe snot change.


    Can someone please asist in this.


    Furthermore, if I run


    Code
    swapoff -a

    It will disable all the zram, and thereby effectively disabling the folder2ram plugin.

  • My OMV 4.x is now using swap eventhough i have alot of free memory available

    That's because kernel developers aren't idiots. They page out (swap) pages that won't be accessed anytime soon or at all. This is a good thing and the kernel does this job better than human beings.


    Also on your ODROID zram is used so there's no IO activity involved but only memory pages that are infrequently used are compressed so there's more free RAM for important stuff. If you don't mess with the settings (why swapoff -a?!) everything is allright.


    OMV runs on top of Linux. This is not as primitive as the operating systems from last Century (back then 'free memory' was something desirable). Linux/Unix implements a concept called virtual memory and therefore deals with memory in a more advanced and way better way than decades ago.

  • I still miss a posibility to get the pages back to ram easily. My background is hpc computing and in fact those page outs are in some cases braeking benchmarking. In general usage of course it is working ver,y well and nobody should mess with it.

  • My background is hpc computing and in fact those page outs are in some cases braeking benchmarking

    Well, then adjust vm.swappiness to 0 if you want to benchmark. When I started to collect benchmark results for various SBC I also took swapping into account but with zram the influence often is negligible.

  • My vm.swappiness is set to "0" by default, but still system is using swap?



    I am really not understanding the whole relationship between flahmemory plugin (folder2ram), the swap "file", and the zram.


    Can someone please, in layman terms, explain what is going on?


    My understanding so far:


    1) /var/log is a virtual directory (somehow bind to /var/folder2ram/log), which in reality is stored on the RAM.
    So when log files are written, they are written to the RAM, and not directly to the SD, to reduce wear.
    -When the system is rebooted, the content of this folder is written back to the sd card? Is this correctly understood?


    2) zram is how the virtual directories are linked between file system in linux, and the physical memory (RAM).
    So the folder2ram script allocates 8 partitions of 128MB (combined1GB) /dev/zram0..zram7 into which the filesystem writes into the RAM.


    3) swap file, on my system is 998MB, and this is used when the system is running out of memory. However I have no idea where the location of this file is, and how to track it down.
    Is these 998MB somehow linked to zram?
    The vm.sswapiness is set to "0".

  • So the folder2ram script allocates 8 partitions of 128MB (combined1GB) /dev/zram0..zram7 into which the filesystem writes into the RAM

    Nope, these are different things.


    The base of the ODROID images is Armbian and Armbian uses zram for swap and its log2ram functionality. With OMV log2ram will be disabled and instead OMV's folder2ram mechanism is used for various locations. Still zram is used for swap.


    With vm.swappiness set to 0 only 'emergency swap' is enabled and as such sometimes in the past your system was running out of memory and swapping occurred. Since it makes absolutely no sense to swap back in those few pages they remain in swap now (zram) and everything is fine.


    The concept of 'free memory' doesn't exist in Unix/Linux. It's good to use the memory and there's nothing wrong if a few memory pages are paged out. And you won't find files for zram since those are block devices using physical RAM as basis layer. Compression does the trick.


    TL;DR: Everything's fine, don't mess with the settings.

  • Well, then adjust vm.swappiness to 0 if you want to benchmark. When I started to collect benchmark results for various SBC I also took swapping into account but with zram the influence often is negligible.

    Right, in most cases it is neglicible, but there are some other cases. Its of course to no value for usecases here. Swapiness is good if I got administration rights, but most useres benchmarking code on cluster dont have that. The only thing working for them is to pre touch all those data so they get back to ram. But than again this may influence l3 cache.


  • My whole problem, is that I might have f..... up, as I panicked and install flashmemory plugin in OMV on my HC1, and forgot that the image already has a version of this plugin installed.
    Mind you i had the image running fine for more than 1 year.



    From the OMV relase note from here:
    "https://sourceforge.net/projects/openmediavault/files/Odroid%20images/"


    It specifically says:
    - openmediavault-flashmemory plugin preinstalled and monitoring disabled to reduce wear on SD card/eMMC.
    I had forgot about this when i installed the flashmemory plugin from the OMV GUI.


    Can I leave everything as is, or do I need to uninstall the flashmemory plugin from GUI again?

  • Please provide output from armbianmonitor -u

    Here it is:


    http://ix.io/1IyZ



    Furthermore when outputting folder2ram -status


    Code
    /var/log is mounted
    /var/tmp is mounted
    /var/lib/openmediavault/rrd is mounted
    /var/spool is NOT mounted
    /var/lib/rrdcached is mounted
    /var/lib/monit is mounted
    /var/lib/php is mounted
    /var/lib/netatalk/CNID is mounted
    /var/cache/samba is mounted

    I wonder why /var/spool cannot be mounted.
    I have restarted without any luck.

  • Here it is:


    ix.io/1IyZ

    Everything's fine:

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!