While the FAQ lists options on memory tuning for ZFS and there is also a tuning guide for FreeBSD (http://wiki.freebsd.org/ZFSTuningGuide), those guides are primarily geared to deal with low memory scenarios.
I recently added 6 more drives to my storage unit and I started getting kernel panics. I have quite a bit of memory (16 G byte) but its less than the recommended 1Gbyte per Tbyte of storage.
I used /usr/local/www/freenasUI/tools/arcstat.pl to view the ZFS memory settings and I found that the settings exceed the memory I have on my server. The vm.kmem_size was set to approximately the amount of total memory I have and vm.kmem_size_max was set to 300Gbytes (!). The vfs.zfs.arc_max was 7% lower than the vm.kmem_size. It appears to me that those values are too high.
Reading through RAM requirements one can assume that FreeNAS requires about 2 G bytes to run plus additional RAM for more involved services.
It would be useful if there would be a guidance article to set appropriate /boot/loader.config variables for ZFS. For that purpose I like to make a suggestion below and hope to get feedback for alternative settings.
# ZFS tuning
####################################################
vm.kmem_size_max="aaaM" # where aaa = total system RAM - 4 G byte
vm.kmem_size="aaaM"
vfs.zfs.arc_max="bbbM" # where bbb = 3/4 -5/6 of vm.kmem_size_max
vfs.zfs.vdev.cache.size="cccM" # where ccc = 5..10 Mbyte
An alternative is to set aaa = 1/2 of total system RAM and vm.kmem_size to 1/4 of total system RAM. However I am not sure about arc_max under these conditions.
Urs
I recently added 6 more drives to my storage unit and I started getting kernel panics. I have quite a bit of memory (16 G byte) but its less than the recommended 1Gbyte per Tbyte of storage.
I used /usr/local/www/freenasUI/tools/arcstat.pl to view the ZFS memory settings and I found that the settings exceed the memory I have on my server. The vm.kmem_size was set to approximately the amount of total memory I have and vm.kmem_size_max was set to 300Gbytes (!). The vfs.zfs.arc_max was 7% lower than the vm.kmem_size. It appears to me that those values are too high.
Reading through RAM requirements one can assume that FreeNAS requires about 2 G bytes to run plus additional RAM for more involved services.
It would be useful if there would be a guidance article to set appropriate /boot/loader.config variables for ZFS. For that purpose I like to make a suggestion below and hope to get feedback for alternative settings.
# ZFS tuning
####################################################
vm.kmem_size_max="aaaM" # where aaa = total system RAM - 4 G byte
vm.kmem_size="aaaM"
vfs.zfs.arc_max="bbbM" # where bbb = 3/4 -5/6 of vm.kmem_size_max
vfs.zfs.vdev.cache.size="cccM" # where ccc = 5..10 Mbyte
An alternative is to set aaa = 1/2 of total system RAM and vm.kmem_size to 1/4 of total system RAM. However I am not sure about arc_max under these conditions.
Urs