FreeBSD 8.2 Release, ZFS + Samba, running out of memory

Jeremy Chadwick freebsd at jdc.parodius.com
Tue Feb 22 22:43:42 UTC 2011


On Tue, Feb 22, 2011 at 10:55:37PM +0100, Henner Heck wrote:
> i experience freezing of my FreeBSD machine when performing certain
> operations
> on a Samba share.
> 
> Technical info:
> - FreeBSD 8.2 Release 64 Bit (it also happened with 8.2 RC3)
> - Samba 3.5.6.1
> - Athlon II Quadcore, 4 GB Ram
> - 1 SSD with a ZFS pool (No.0) containing the FreeBSD system
> - 12x2TB RaidZ2 pool (No.1) for data, created on 12 GEOM eli encrypted
> partitions on 12 disks,
>     shared to a Windows 7 PC with Samba,
>     8 of the disks are attached to 2 Marvell SATA controllers, 4 to the
> onboard controller
> - ZPool v15, ZFS v4
> 
> Scenarios (checked using top):
> 
> A:
> When copying files from one directory in pool 1 to another, the free
> memory drops from
> about 3700M to abaout 200M in the process, but seems to stabilize then.
> 
> B:
> When copying the files onto a Windows machine using the Samba share,
> the free memory seems to stabilize at about 100M.
> 
> C:
> When computing a hashvalue of files from the share on Windows or doing a
> binary compare to copies of the files stored on the Windows PC (using
> Total Commander),
> the free memory on the FreeBSD machine drops even lower and shortly
> after the BSD system freezes.
> Here is the last top output i got via ssh:
>
> ...
> 
> Does anyone have advice on how to get rid of this problem?
>
> ...
>
> *smb.conf* (a bit anonymized)
> 
> [global]
> use sendfile = true

Set this to "false" and the problem might go away.  You can try some of
the patches others have recommended as well (which will permit you to
use sendfile going forward), but if you don't want to deal with patches,
the workaround should be fine.

If you still experience issues after that, possibly some loader.conf
tuning for ZFS is needed.

Also, one question: when you say "freezes", do you mean "completely
locks up hard" or "the system seems alive but seems to be spending all
of its CPU time doing something else"?  Try hitting NumLock on the
system's keyboard to see if the LED toggles on/off; if it does, the
system isn't frozen, but is catatonic to some degree.

-- 
| Jeremy Chadwick                                   jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.               PGP 4BD6C0CB |



More information about the freebsd-stable mailing list