Samba (smbd) memory leak

  • After transferring a large file (>100GB) via samba, the service smbd does not release memory (uses more than 76% of memory).


    Code
    # ps aux --sort '%mem'
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    ...
    backup-+ 12587  0.9 76.1 6737736 4631684 ?     S    Dec12   9:38  \_ /usr/sbin/smbd --foreground --no-process-group

    After restarting smbd, everything is OK


    Code
    # systemctl restart smbd
    # ps aux --sort '%mem' | grep smbd
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root      9953  0.0  0.0   6080   892 pts/0    S+   08:27   0:00 grep smbd
    root      9919  0.0  0.1  46692  6184 ?        S    08:27   0:00 /usr/sbin/smbd --foreground --no-process-group
    root      9918  0.0  0.1  46676  6416 ?        S    08:27   0:00 /usr/sbin/smbd --foreground --no-process-group
    backup-+  9925  0.0  0.2  50792 14132 ?        S    08:27   0:00 /usr/sbin/smbd --foreground --no-process-group
    root      9924  0.1  0.2  50920 14340 ?        S    08:27   0:00 /usr/sbin/smbd --foreground --no-process-group
    root      9911  0.5  0.3  50572 20632 ?        Ss   08:27   0:00 /usr/sbin/smbd --foreground --no-process-group



    This problem is repeated on different installations and hardware.


    Version:


    OMV 5.6.21-2


    # samba -V

    Version 4.9.5-Debian

  • Ocean

    Hat das Label OMV 5.x hinzugefügt.
    • Offizieller Beitrag

    I doubt this is a memory leak. It is probably just Linux file cache - https://www.linuxatemyram.com/. Did you look at the output of free -m? If it truly is a memory leak, OMV is using Debian provided packages since OMV is debian. So, a bug report would need to be filed with Debian to get a fix.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    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!

  • This is not a cache

    Code
    # free -m
                  total        used        free      shared  buff/cache   available
    Mem:           3933        3062         284           4         586         637
    Swap:          4093        2197        1896

    used 3062...


    and begins to use swap...

    • Offizieller Beitrag

    This is not a cache

    What else is running on the box? Samba would be causing lots of people problems if there was a memory leak.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    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!

  • What else is running on the box? Samba would be causing lots of people problems if there was a memory leak.

    I was mistaken in the previous post. The zabbix-agent is running on only one server, but the problem is present on two servers.


    The problem appears only when a large file is transferred (about 100 GB) and at a speed> 70 mb / s


    I will watch the problem.

  • Wonder if you’re still having this issue? It started for me under OMV6 with a oom-killer. So I increased ram from 2Gbto 4Gb. Still getting the error, with smbd taking 3.5Gb after every restart.

  • It started for me for a while now, it happens when I transfer large files i.e.:

    It happens when I try to backup a disk using clonezilla, now it happened after I transfered a 20GB file.

    Look at the screenshot below: until last night around 10 PM memory usage was kinda flat, at 10 I transfered the 20GB file to the server.

    It went bonkers and got oom killed around 4 AM, after samba was killed memory usage goes flat again to levels similar to before 10 PM.


    The fact that it was killed at 4 AM is also telling that it happened around the time cron.daily runs. Perhaps, cron ran and pushed the memory usage up, but the oomkiller chose samba.

    Still, the fact that samba didn't free the memory after 6 hours is weird :).


    I can say that samba was killed because I have the log here too below the screenshot.



  • It happens when I try to backup a disk using clonezilla,


    I happens to me exactly the same when I doing a smb backup to OMV with clonezilla. Seems it's a repeated problem.

    Einmal editiert, zuletzt von upsangel () aus folgendem Grund: supplement: I check the file that the samba stopped at when the img files jus reached over 100G

Jetzt mitmachen!

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