FreeBSD-EN-22:22.tzdata.asc FreeBSD-EN-22:28.heimdal.asc FreeBSD-EN-23:01.tzdata.asc FreeBSD-EN-23:04.ixgbe.asc (reboot) FreeBSD-SA-22:14.heimdal.asc FreeBSD-SA-22:15.ping.asc FreeBSD-SA-23:01.geli.asc (reboot)
FreeBSD-EN-22:22.tzdata.asc FreeBSD-EN-22:28.heimdal.asc FreeBSD-EN-23:01.tzdata.asc FreeBSD-EN-23:04.ixgbe.asc (reboot) FreeBSD-SA-22:14.heimdal.asc FreeBSD-SA-22:15.ping.asc FreeBSD-SA-23:01.geli.asc (reboot)
The performance degradation occurs when your zpool is either very full or very fragmented. The reason for this is the mechanism of free block discovery employed with ZFS. Opposed to other file systems like NTFS or ext3, there is no block bitmap showing which blocks are occupied and which are free. Instead, ZFS divides your zvol into (usually 200) larger areas called "metaslabs" and stores AVL-trees1 of free block information (space map) in each metaslab. The balanced AVL tree allows for an efficient search for a block fitting the size of the request. While this mechanism has been chosen for reasons of scale, unfortunately it also turned out to be a major pain when a high level of fragmentation and/or space utilization occurs. As soon as all metaslabs carry a significant amount of data, you get a large number of small areas of free blocks as opposed to a small numbers of large areas when the pool is empty. If ZFS then needs to allocate 2 MB of space, it starts reading and evaluating all metaslabs' space maps to either find a suitable block or a way to break up the 2 MB into smaller blocks. This of course takes some time. What is worse is the fact that it will cost a whole lot of I/O operations as ZFS would indeed read all space maps off the physical disks. For any of your writes. The drop in performance might be significant. If you fancy pretty pictures, take a look at the blog post over at Delphix which has some numbers taken off an (oversimplified but yet valid) zfs pool. I am shamelessly stealing one of the graphs - look at the blue, red, yellow, and green lines in this graph which are (respectively) representing pools at 10%, 50%, 75%, and 93% capacity drawn against write throughput in KB/s while becoming fragmented over time: