LXC/mdadm/SMB : Memory leakage during large file transfer by SMB protocol

jbsk

Renowned Member
Mar 28, 2017
36
5
73
To sum up, I have a debian LXC container running samba4. I share a network directory that is a PVE mount point (mp0) on a RAID10 directory with mdadm.


During the transfer of large file in writing to the SAMBA4 server, I have a drop in RAM that tends to 0 from the container, verifiable with the 'top' command.
This is worrisome because when it's zero, I have the transfer that also falls to zero, the pve kernel that logs a samba4 crash.

I tried on another container with the samba4 packages proposed with debian. I have the same problem.
However, on a virtual machine (kvm), with a sata1 mount point, I no longer have the problem, the transfer is done without memory loss.

I tested other mount point, like a ZFS0 with 2 disks, no problem, just like a ZFS0 SSD.

Apart from passing the RAID10 to ZFS, a track to dig?
 

Attachments

Most Probably the host kernel killed the samba process because it was using more memory that the whole container 103 was allowed to use:
* [ 1044.690344] Memory cgroup out of memory: Kill process 17172 (smbd) score 23 or sacrifice child
* Task in /lxc/103/ns/system.slice killed as a result of limit of /lxc/103

Allocate more RAM to your container or use Samba in a VM
 
It seems that mdadm and zfs have trouble living together, even in a virtual machine.
In fact, when I did my tests, mdadm wasn't loaded, so I did have a good result with zfs.

I deleted mdadm to go to zfs.