# Best ZFS tuning for FreeBSD 10.2 on an i386 system with 4GB of physical RAM



## Kalero (Oct 15, 2015)

Hi! Last afternoon I was trying to install FreeBSD 10.2 RELEASE i386 on my PC, on a ZFS file system. I got the warning saying that recommended minimum kmem_size is 512MB, so I could expect unstable behavior (like it's shown at the picture below). Then, I've been reading that ZFS on i386 systems needs some tuning and --I don't know if I understood that correctly-- to find the most suitable value for vm.kmem_size and vm.kmem_size_max, you should divide the address space by four. So, what's the best value for those parameters if I have 4GB of physical RAM memory? Thanks


----------



## kpa (Oct 15, 2015)

You should compile a custom kernel with options KSTACK_PAGES=4. There are known issues with GENERIC kernel on the i386 architecture that affect the stability of the system when ZFS is used.

https://www.freebsd.org/releases/10.2R/errata.html

(near the middle of the document, section 4, "Open Issues").

For the vm.kmem_size and vm.kmem_size_max settings start by setting them to 512MB.


----------



## Kalero (Oct 15, 2015)

Thanks, kpa 

Maybe this is a stupid question but there, in the warning message, it says that, by default, freebsd-update installs the GENERIC kernel configuration and, as such, ZFS on i386 users should avoid kernel updates through freebsd-update with such configuration. Then, what's the way to update the system? In the past, I always used freebsd-update to do that...


----------



## kpa (Oct 15, 2015)

Subversion for fetching and updating the system sources:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/svn.html

Source based updates/upgrades:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html


----------



## Kalero (Oct 15, 2015)

I'll read that. Thanks again


----------



## Oko (Oct 15, 2015)

ZFS should not be used on i386 32-bit machines. FreeBSD should do the right thing and remove support for ZFS from i386 just like DragonFly guys completely killed their 32-bit branch since HAMMER is also only 64-bit file system.


----------



## Kalero (Oct 15, 2015)

Thanks for your share, Oko. In my case, I would want to create the ZFS pool on a machine with an Intel Core 2 Duo processor, but yes, it's a 32 bit processor.


----------



## fredrike (Oct 19, 2015)

Kalero said:


> Thanks for your share, Oko. In my case, I would want to create the ZFS pool on a machine with an Intel Core 2 Duo processor, but yes, it's a 32 bit processor.



No, Intel Core 2 Duo is a 64-bit CPU.

You should install the amd64 version on your system (https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall-hardware.html).


----------



## Kalero (Oct 20, 2015)

Thanks,  fredrike. Because my Windows version is 32-bit I thought my processor was also 32-bit.


----------



## kpa (Oct 20, 2015)

Kalero said:


> Thanks,  fredrike. Because my Windows version is 32-bit I thought my processor was also 32-bit.



There are two families of Intel CPUs that are named almost the same, Intel Core Duo and Intel Core 2 Duo. The first one is 32-bit only and the second one is the 64-bit capable CPU family.


----------



## Kalero (Oct 20, 2015)

Thanks, kpa


----------

