ZFS ZFS warning about minimum kmem_size

Hi!

During boot I see message with text:
Code:
ZFS WARNING: Recommended minimum kmem_size is 512MB; expect unstable behavior.
                         Consider tuning vm.kmem_size and vm.kmem_size_max
                         in /boot/loader.conf.
I added those line to /boot/loader.conf
Code:
vm.kmem_size="512M"
vm.kmem_size_max="1024M"
but warning still appears at boot time.

What should I do to fix this warning?

My machine is i386 with 1GB of ram.
 
Given that your machine only has 1GiB of RAM, there may be some limiting going on. Maybe vm.kmem_size just won't grow enough.

There are lots of people who say that you need XXX of memory (large number) to run ZFS. I run it very successfully on a 3GiB machine, and yet people keep telling me that I'm crazy and stupid and shouldn't do it. With your much smaller memory, you might actually have found the pain threshold. Yet, online searches show people running successfully with 1GiB.

Look at the handbook, chapter on ZFS tuning: https://www.freebsd.org/doc/handbook/zfs-advanced.html
It has a link at the bottom for even more tuning.
Check all these numbers.
 
I run it very successfully on a 3GiB machine, and yet people keep telling me that I'm crazy and stupid and shouldn't do it.
I've ran it on 2GB even. But with the 64 bit version though. There used to be quite some restrictions with using ZFS on i386, I'm not sure if that's still the case. In my opinion i386 with only 1GB is just a bad combination to use ZFS on, way too finicky. Not worth the trouble in my view.

My machine is i386 with 1GB of ram.
Is there a specific need for ZFS on this machine? I would just use the normal UFS for this machine.
 
I want to create a mirrored storage, as I know zfs makes it easy and reliable.
For UFS you can use gmirror(8). Or use a proper RAID controller to handle the mirror. Neither have the "healing" capabilities ZFS has of course but will work just as well for redundant storage.
 
the vm.kmem_size value does not change, it is always 339423232, no matter what values I set in /boot/loader.conf.
 
Easiest way to check (you probably already found that): sysctl ...

Why doesn't it change? Hmm. No idea. Do a web search. I bet there is some mechanism that says "no more than XXX is supposed to be kernel memory", to protect people with low-memory systems (you!) from their kernel eating to much. The "XXX" is probably not a fixed number, but probably some ratio or difference. That mechanism is probably tunable too, but I don't even know where it is or how it works.

The hard-core technique would be looking at the kernel source, and reading comments wherever kmem_size is changed. I think the web will be easier and faster.
 
Have you tried the settings in /boot/loader.conf using real whole numbers instead of suffixes???
 
Ok, I found the reason for the error, previously I used this script for grub to start FreeBSD:
Code:
menuentry "FreeBSD" --class freebsd --class bsd --class os {
 insmod ufs2
 insmod bsd
 set root=(hd0,2)
 kfreebsd /boot/kernel/kernel
 kfreebsd_loadenv /boot/device.hints
 set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0s1a
 set kFreeBSD.vfs.root.mountfrom.options=rw
 set kFreeBSD.hw.psm.synaptics_support=1
}
now I changed it to:
Code:
menuentry "FreeBSD" --class freebsd --class bsd --class os {
 insmod ufs2
 insmod bsd
 set root=(hd0,2)
 chainloader (hd0,2)+1
}
and vm.kmem_size is set to the desired value.
 
Back
Top