• [6.8.3] shfs memory leak?


    Mikael
    • Urgent

    During the last two weeks or so, my unRAID server has started to shut down all shares due to shfs using too much memory.

     

    Here is a snippet from an earlier log where shfs ended up using so much memory that it was shut down:

    Quote

    Mar 20 23:42:20 nas kernel: Out of memory: Kill process 4305 (shfs) score 482 or sacrifice child
    Mar 20 23:42:20 nas rsyslogd: file '/var/log/syslog'[4] write error - see https://www.rsyslog.com/solving-rsyslog-write-errors/ for help OS error: No space left on device [v8.1908.0 try https://www.rsyslog.com/e/2027 ]
    Mar 20 23:42:20 nas kernel: Killed process 4305 (shfs) total-vm:38210132kB, anon-rss:31803700kB, file-rss:4kB, shmem-rss:1132kB

     

    My quickest way of reproducing it so far has been to turn on my minio docker container and run backups to it from other machines. That way shfs builds its memory usage with several gigabytes in a matter of minutes.

    I've uninstalled all plugins but Unassigned Devices, which I need for my VM's, in an attempt to see if that was the cause.

     

    The attached diagnostics is from today, after I uninstalled all plugins, and limited the amount of running VMs and docker containers. It hasn't crashed yet in this log but it is only a matter of time, seeing as shfs was using 20 GB of memory and growing.

     

    By disabling most of my docker containers and turning off some VMs, I am able to run the system for a few days before the shares are cut off, but I really hope to find a fix rather quickly.

     

    240983180_unRAIDshfshighmemoryusage.thumb.PNG.04bd5a5689355928efae0ec55cce5253.PNG

     

    nas-diagnostics-20200322-1242.zip




    User Feedback

    Recommended Comments

    Also, why do you have 100G allocated to docker image? That usually means a user has their docker applications misconfigured. 20G will usually be more than enough, and if it grows beyond that you need figure out what you have done wrong.

     

    An application will write into the docker image if it is writing to a path that isn't mapped to Unraid storage. This often happens from using the wrong upper/lower case, or from using a relative instead of an absolute path.

     

    On the other hand, a container will write into memory if it is mapped to a host path that isn't actual storage. Note that an unmounted Unassigned Device isn't actual storage either.

    Link to comment

    Hi @trurl, it does not seem to happen when I turn off the docker containers that use the unRAID shares.

     

    The 100G docker image was just because I could. Only around 3G is in use. Prior to testing for this issue, all docker container paths were mounted to unRAID shares. The docker image was probably still on the unassigned device.

     

    I can lower the size of the docker container image and move it to the unRAID shares again tomorrow, to see if that helps.

    Link to comment

    I recreated the docker image with a lower size and moved it and the mounted paths to unRAID shares.

    The shfs memory usage still grows, although possibly a bit slower, when backing up to the mino docker container.

    When stopping the backup, the memory usage drops quite a bit now, which I don't remember happening previously.

     

    I monitored the size used by the docker containers, and there was no growth there.

     

    The high shfs memory usage produced yesterday, still remained today, even after shutting down the docker and vm services.

    Link to comment

    Anyone have any other suggestions?

    The problem is still here. I am able to reproduce the issue when validating backups as well, which presumably doesn't write to the server, only read.

    Edited by Mikael
    Link to comment

    There's another shfs memory related report, but in that case it evens happens on a clean install without any docker/VMs running, can you confirm in your case it only happens with dockers enable?

     

    Strange that only two users have this issue, especially if it's not even reproducible the same way.

    Link to comment

    Hi @johnnie.black, it only happens with dockers running.

    As far as I can tell only with the minio docker. That's the only one that is able to produce over 40 GB of memory usage for shfs in a couple hours.

    Link to comment

    Did you ever get a resolution to this? I am having the same issue suddenly. Wake up to 98% memory utilization out of 128G of memory on my system. Unraid 6.8.3

    Link to comment

    Hi @springsman

    I didn't find a solution to this problem. I ended up not backing up one of my computers, since that one was responsible for the most rapidly increasing memory usage. Probably because the backup size was quite large.

    Link to comment
    3 hours ago, springsman said:

    By any chance were you using ARQ Agent for your backup software?

    I am indeed using Arq. It's the windows based agent that seems to cause the highest memory consumption. It is also the largest backup, so the Windows part may not be a significant factor.

    Link to comment

    So it looks like it may be an ARQ issue somehow. I also had a large backup from my MacPro to my Unraid server using ARQ and Minio, and after the last update to Minio this is when the memory leak started. I deleted the entire backup folder on the Unraid and started a new backup using ARQ, and so far it seems to have worked. Will know more once the entire backup is complete.

    Link to comment

    Looks like deleting and starting a new backup on Unraid has fixed the memory leak issue. Not sure why ARQ running on my MacPro would cause Minio on my Unraid to utilize 98% of the 128GB of memory available. Hope this helps anyone else seeing this issue.

    Link to comment


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.