I'm getting miserable write performance out of my newly built FreeNAS server when writing to it over NFS from a Linux (Debian) machine. I'm experiencing low overall speeds, and sometimes the catatonic states that jgreco mentions in https://bugs.freenas.org/issues/1531 . My catatonic states sometimes lasts for about 20-30 seconds.
FreeNAS machine specs:
Motherboard: ASRock E3C226D2I
CPU: Intel Core i3-4130T (supports AES-NI)
Memory: Kingston 16GB DDR3 1333MHz ECC unbuffered (2x8) KVR1333D3E9SK2/16G
Hdd1 (ada0): Hitachi Deskstar 4TB HDS724040ALE640
Hdd2 (ada1): Western Digital Red 4TB WD40EFRX-68WT0N0
I first just installed FreeNAS on a USB stick, booted up, and created an encrypted, mirrored ZFS volume with lz4 compression, no atime, no dedup, and then a dataset within that volume (same settings regarding compression, encryption, atime and dedup). Then NFS exported that dataset.
Copying a 963GB directory structure from the Linux system (ext4) that "df -k" says is 1008909496k large took just over 24 hours! That comes in at just below 12MB/s, which is not cool. And the FreeNAS CPU usage never went above 20%, so to me it doesn't look like it's the CPU that's holding the system back.
I've since done a lot of tests, both dd'ing files and /dev/zero locally on the FreeNAS machine, and dd'ing files and /dev/zero and cp'ing files over NFS from the Linux machine to FreeNAS. Local FreeNAS performance is good regardless of compression/encryption, and read performance from FreeNAS to Linux is really good.
I've tested network performance with iperf, and I do get gig speeds between the Linux and FreeNAS machines in both directions.
I've dd'd 110GB (mpeg2 data) from Linux to FreeNAS over nc, writing it to the dataset, and achieved 102MB/s, so when taking NFS out of the picture things perform just fine. Reading that 110GB file back to Linux over NFS (dd'ing it to /dev/null) also works fine, achieving 97MB/s read performance over NFS.
But NFS write performance sucks... there are a few 90MB/s peaks, but sometimes is drops to below 1MB/s, and an average of 12MB/s is plain not aceptable or usable.
So does anyone have any tips on what settings are best for a Linux NFS client accessing a FreeNAS (9.2.1.1) NFS server? Should tuning be done on the Linux or FreeNAS side? What needs to be tuned?
I don't have any FreeBSD, Windows, or OSX machines to use as clients to find where the problem is or do additional testing, unfortunately.
I've searched both on these forums and using Google, but haven't found anything that works for me. I've looked at the Linux NFS-Hotwo but it's recommendations on "Optimizing NFS Performance" has yielded nothing. Adjusting wsize/rsize on the Linux machine has neglible impact.
Or should I just give up on NFS and use CIFS or SSHfs instead? (For some reason I can't get CIFS running under FreeNAS (it can't find winbind, smbd or nmbd), but I'm guessing I've just made some mistake somewhere, or need to install some additional software on the FreeNAS machine.)
FreeNAS machine specs:
Motherboard: ASRock E3C226D2I
CPU: Intel Core i3-4130T (supports AES-NI)
Memory: Kingston 16GB DDR3 1333MHz ECC unbuffered (2x8) KVR1333D3E9SK2/16G
Hdd1 (ada0): Hitachi Deskstar 4TB HDS724040ALE640
Hdd2 (ada1): Western Digital Red 4TB WD40EFRX-68WT0N0
I first just installed FreeNAS on a USB stick, booted up, and created an encrypted, mirrored ZFS volume with lz4 compression, no atime, no dedup, and then a dataset within that volume (same settings regarding compression, encryption, atime and dedup). Then NFS exported that dataset.
Copying a 963GB directory structure from the Linux system (ext4) that "df -k" says is 1008909496k large took just over 24 hours! That comes in at just below 12MB/s, which is not cool. And the FreeNAS CPU usage never went above 20%, so to me it doesn't look like it's the CPU that's holding the system back.
I've since done a lot of tests, both dd'ing files and /dev/zero locally on the FreeNAS machine, and dd'ing files and /dev/zero and cp'ing files over NFS from the Linux machine to FreeNAS. Local FreeNAS performance is good regardless of compression/encryption, and read performance from FreeNAS to Linux is really good.
I've tested network performance with iperf, and I do get gig speeds between the Linux and FreeNAS machines in both directions.
I've dd'd 110GB (mpeg2 data) from Linux to FreeNAS over nc, writing it to the dataset, and achieved 102MB/s, so when taking NFS out of the picture things perform just fine. Reading that 110GB file back to Linux over NFS (dd'ing it to /dev/null) also works fine, achieving 97MB/s read performance over NFS.
But NFS write performance sucks... there are a few 90MB/s peaks, but sometimes is drops to below 1MB/s, and an average of 12MB/s is plain not aceptable or usable.
So does anyone have any tips on what settings are best for a Linux NFS client accessing a FreeNAS (9.2.1.1) NFS server? Should tuning be done on the Linux or FreeNAS side? What needs to be tuned?
I don't have any FreeBSD, Windows, or OSX machines to use as clients to find where the problem is or do additional testing, unfortunately.
I've searched both on these forums and using Google, but haven't found anything that works for me. I've looked at the Linux NFS-Hotwo but it's recommendations on "Optimizing NFS Performance" has yielded nothing. Adjusting wsize/rsize on the Linux machine has neglible impact.
Or should I just give up on NFS and use CIFS or SSHfs instead? (For some reason I can't get CIFS running under FreeNAS (it can't find winbind, smbd or nmbd), but I'm guessing I've just made some mistake somewhere, or need to install some additional software on the FreeNAS machine.)