[geeks] One, two, three, panic!

Phil Stracchino alaric at metrocast.net
Mon Mar 16 07:23:32 CDT 2009


Jonathan C. Patschke wrote:
> On Sun, 15 Mar 2009, Phil Stracchino wrote:
> 
>> But this time I saw it.  Reinstalled 7.1R-i386, remirrored boot, set up
>> a zpool on the 9500, put /usr/ports onto it, tried to do an updatedb for
>> locate, and FreeBSD fell over instantly:
> 
> Did you tune your kernel prior to setting up the zpool?  ZFS on
> FreeBSD/i386 is extremely panic-prone if you don't tune first because of
> the massive amount of kernel memory it can ask for on short notice.
> FreeBSD/i386 tends to keep the kernel footprint slim because of the
> architectural limits of the i386 memory map.
> 
> Specifically, you'll want at least these tunables in /boot/loader.conf:
>    vfs.zfs.arc_min="32M"
>    vfs.zfs.arc_max="256M"
>    vfs.zfs.prefetch_disable=1
> 
> I also have:
>    vm.kmem_size_max="1536M"
>    vm.kmem_size="1536M"

So the doc that says keep vm.kmem_size_max UNDER 400M is wrong?

I'm guessing I'd probably want to turn vfs.zfs.arc up fairly well, since
the box is going to be running fairly little in userspace.  (Basically
it's intended to run nfsd, smbd, apache2, mysqld, Postfix, bind9 and
Bacula, and that's about it.)

I hadn't come across the "known problems" doc Michael Turner referenced.
 Frankly, reading that really makes it sound as though even on amd64,
ZFS on FreeBSD really isn't ready to be actually used yet.  Going by
that document, there is no such thing as a really stable FreeBSD+ZFS
configuration, particularly on i386.


> This information sounds uselessly out-of-date.  Where did you find it?  I
> can't remember the last time I installed FreeBSD on a system with -less-
> than 1GB memory.

It was about the third or fourth hit (and the first with actual
information) on that error.

> In 7.x, this doesn't need to be compiled-in, it can be set in
> /boot/loader.conf.

OK, I hadn't found that yet.

> I think you misunderstand the fix.  The FreeBSD kernel reserves a certain
> amount range of physmem specifically for its use.  vm.kmem_size_max
> regulates the maximum amount of memory the kernel will claim.  The panic
> you got indicates that the kernel needed to allocate more than the limit.
> Raising the limit from 320MB to 400MB would probably make that go away,
> provided that the need is genuine or you've managed to cap whatever is
> leaking.

That's what I'd have assumed, yes, but the documented fix said set it
400M *or lower* but not to exceed 400M.

It seemed odd to me, but, well, it was documented...

> If you were wondering, I doubt this is related to your problem running
> FreeBSD/amd64, in any case.

I didn't think so.  That's clearly a separate issue.


-- 
  Phil Stracchino, CDK#2     DoD#299792458     ICBM: 43.5607, -71.355
  alaric at caerllewys.net   alaric at metrocast.net   phil at co.ordinate.org
         Renaissance Man, Unix ronin, Perl hacker, Free Stater
                 It's not the years, it's the mileage.



More information about the geeks mailing list