I am running 9.2/amd64 on an old box with 4 GB of RAM. I have mirrored ZFS drives. My system would run fine after a reboot but within a day or so I would experience performance problems: SSH sessions would occasionally hang for several seconds (concurrent sessions would be fine); Samba would hang or take forever to load a directory.
After some trial and error I've found that the problems stem from memory starvation caused by the default ARC settings. The following settings are chosen by the system:
Making the following changes to /boot/loader.conf has removed the performance issues, but may not be optimal settings.
I'm new to ZFS so I'm still making sense from the output of
I'll follow up with the results of further experimentation, but the above settings should help anyone with a 4 GB system.
After some trial and error I've found that the problems stem from memory starvation caused by the default ARC settings. The following settings are chosen by the system:
Code:
real memory = 4294967296 (4096 MB)
avail memory = 4082089984 (3892 MB)
vm.kmem_size_max: 329853485875 (307 GB)
vm.kmem_size: 4111114240 (3921 MB)
vfs.zfs.arc_min: 379671552 (362 MB)
vfs.zfs.arc_max: 3037372416 (2897 MB)
Making the following changes to /boot/loader.conf has removed the performance issues, but may not be optimal settings.
Code:
vm.kmem_size="3072M"
vfs.zfs.arc_min="128M"
vfs.zfs.arc_max="2048M"
I'm new to ZFS so I'm still making sense from the output of
zfs-stats. It wasn't obvious to me that memory was the issue, but it seems that if your free system memory drops below 5% or the logical free memory drops below 10% you may experience the issues I was seeing.I'll follow up with the results of further experimentation, but the above settings should help anyone with a 4 GB system.