Documentation on ZFS writing to unbalanced virtual devices

AlistairM

Cadet
Joined
Dec 10, 2023
Messages
1
TLDR: I'm looking for the documentation on how ZFS writes to unbalanced virtual devices.

I've seen several posts explaining how ZFS handles a new virtual device being added to a pool, and these have been contradictory to each other, or to my own experiments. The read/write speed on my NAS is less than expected. I'm looking to speed it up.

I'm running TrueNas Scale 22.12.3.2, with ZFS version zfs-2.1.11-1.
My NAS contains 2 virtual devices, running raidz2. One is made of seven 14TB SAS drives (WUH721414AL5204) with a sustained transfer rate of 267 MB. The other has seven 16TB SAS drives (ST16000NM000J-2TW103) with a sustained transfer rate of 270 MB/s.
The NAS uses GZIP compression.
A 128 GB SSD is being used as a cache.

The theoretical max read/write speed should be 267 * (7-2) * 2 = 2670 MB/s.

I've created a 10GB file from /dev/urandom. Testing the read speed with dd if=random_file of=/dev/null bs=1M count=10000 from this file gives a read speed of 810 MB/s. Testing the write speed with dd if=random_file of=file2 bs=1M count=10000 gives a write speed of 539 MB/s.

The 14TB drives seem to have maxed out their utilisation (the drives running at 95%+). The drives running at 50%+ are the 16TB drives.
image-20231211-023418.png

Screenshot from 2023-12-11 15-35-04.png

I've looked at the open zfs page, https://openzfs.github.io/openzfs-docs/Getting Started/index.html, but I'm unable to find docs on writing to unbalanced vdevs. If it were the case that data is written to the least full vdevs until all vdevs are balanced, the 14 TB vdev wouldn't be running at 98% utilisation. If it were the case that the data is written to each vdev proportional to the amount of free space, then I would presume that the 16TB vdev would have a much higher utilisation than 50% since it is writing far more data (note the 14TB vdev is 90% full). If it were the case that data is written to each vdev in proportion to the current speed of each disk, then I would expect a 98% utilisation on both vdevs.

Does anyone have a link to the relevant documentation please?
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
The alorithm is complex as can be seen from this thread


Not sure you should look at disk utilization.... that's just the cap on the drives/system. Your older drives are more fragmented and so may require more operations.
Better to focus on write bandwidth sda- sdf seems to have 5X the write bandwidth... they are the 14TB drives?

The drives are different vendors and models. I wonder if they have different write latency characteristics?
 
Top