paleoN
Wizard
- Joined
- Apr 22, 2012
- Messages
- 1,402
As the title suggest this post is about ZFS Breathing/Write Stalls many of us have seen. I was experiencing it myself though to a lesser degree compared to some. I decided I would run some benchmarks and see what I could come up with.
My current system is:
FreeNAS-8.2.0-BETA3-x64
ASUS F1A75-V Pro
AMD A6-3500 Llano CPU
8GB DDR3 RAM
2 x Seagate ST2000DM001 2TB
Intel 9301 CT NIC
Relevant Tuneables:
vfs.zfs.arc_max 4539433088 Generated by autotune
vm.kmem_size 4490539929 Generated by autotune
Client:
Win XP SP3 FileZilla 3.5.3
6.12GB, 10GB, 15.3GB, 50GB files
I'm using FTP to benchmark as I get very consistent and fast transfers. I rebooted after every new array setup. I began by blowing away my mirror and creating a UFS mirror as a control. UFS performed as I knew it would.
NOTE: I'm using Bandwidth Monitor to create the graphs. It has inaccuracies in that you get a false positive, false negative?, as often as everything 35 or so seconds. If you see a small blue bar at the very bottom ignore that dip. It didn't actually happen.
NOTE2: I know the graphs are too tall, but I'm not redoing them.
I then proceeded to create a ZFS stripe. It appeared to manage well with an empty pool and the auto-tuned settings for an 8 GB NAS.
One thing to keep in mind is that an empty pool performs better than one that's been in use for a while.
I proceeded to recreate my ZFS mirror and ran into the above. I then loaded up the mirror with 300+ gig of data and transfered & deleted
things over a few of days. My problem returned though not as severe as I remember.
Finally, on to some tuning. I first enabled vfs.zfs.txg.timeout with a value of 5, the default as of ZFS v28. Very noticeable improvements with my setup.
This is a CIFs transfer by the way.
I then calculated the max raw write speed, of my faster drive, as 188 MB/s. Which is what I set vfs.zfs.txg.write_limit_override to 197132288.
Looks like around 80MB/s is all the mirror can sustain with that value.
I next tried with 2x 188 MB/s - 394264576, which just happens to be about 3x 120 MB/s.
I then tested vfs.zfs.txg.write_limit_override at 1073741824, often recommended for 8GB systems, and at 591396864, 3x 188 MB/s. Both are too high for my system and I get too much latency during ZFS write flushing.
I currently running at 492830720, 2.5x.
492830720 seems a great match with the mirror I'm running. I think it's slightly better than 394264576, but I didn't really run with
that value long enough to be sure.
Finally, I reran the dd benchmark with my current settings and it came out to 120 mb/s. I've definitely tuned my NAS for something and it's never run better, but at the end I'm not entirely sure why
The 1073741824 for 8GB systems never made sense to me with my limited understanding the write performance of your zpool should be the limiting factor though network speed plays its part.
I'm interested if anyone else has tried any ZFS tuning and what the results were.
My current system is:
FreeNAS-8.2.0-BETA3-x64
ASUS F1A75-V Pro
AMD A6-3500 Llano CPU
8GB DDR3 RAM
2 x Seagate ST2000DM001 2TB
Intel 9301 CT NIC
Relevant Tuneables:
vfs.zfs.arc_max 4539433088 Generated by autotune
vm.kmem_size 4490539929 Generated by autotune
Client:
Win XP SP3 FileZilla 3.5.3
6.12GB, 10GB, 15.3GB, 50GB files
I'm using FTP to benchmark as I get very consistent and fast transfers. I rebooted after every new array setup. I began by blowing away my mirror and creating a UFS mirror as a control. UFS performed as I knew it would.
NOTE: I'm using Bandwidth Monitor to create the graphs. It has inaccuracies in that you get a false positive, false negative?, as often as everything 35 or so seconds. If you see a small blue bar at the very bottom ignore that dip. It didn't actually happen.
NOTE2: I know the graphs are too tall, but I'm not redoing them.

I then proceeded to create a ZFS stripe. It appeared to manage well with an empty pool and the auto-tuned settings for an 8 GB NAS.

One thing to keep in mind is that an empty pool performs better than one that's been in use for a while.
I proceeded to recreate my ZFS mirror and ran into the above. I then loaded up the mirror with 300+ gig of data and transfered & deleted
things over a few of days. My problem returned though not as severe as I remember.


Finally, on to some tuning. I first enabled vfs.zfs.txg.timeout with a value of 5, the default as of ZFS v28. Very noticeable improvements with my setup.

This is a CIFs transfer by the way.
I then calculated the max raw write speed, of my faster drive, as 188 MB/s. Which is what I set vfs.zfs.txg.write_limit_override to 197132288.

Looks like around 80MB/s is all the mirror can sustain with that value.
I next tried with 2x 188 MB/s - 394264576, which just happens to be about 3x 120 MB/s.

I then tested vfs.zfs.txg.write_limit_override at 1073741824, often recommended for 8GB systems, and at 591396864, 3x 188 MB/s. Both are too high for my system and I get too much latency during ZFS write flushing.
I currently running at 492830720, 2.5x.


492830720 seems a great match with the mirror I'm running. I think it's slightly better than 394264576, but I didn't really run with
that value long enough to be sure.
Finally, I reran the dd benchmark with my current settings and it came out to 120 mb/s. I've definitely tuned my NAS for something and it's never run better, but at the end I'm not entirely sure why
The 1073741824 for 8GB systems never made sense to me with my limited understanding the write performance of your zpool should be the limiting factor though network speed plays its part.
I'm interested if anyone else has tried any ZFS tuning and what the results were.