Writing speed on FreeBSD 13.1-p2 amd64 with ZFS
This is a repeat of the test I ran in 2020 on the same desktop hardware, but now using the ZFS filesystem. Additionally, I’m now also testing the harddisk in the desktop.
Again, the test is writing approximately 10 GB data from /dev/zero
to
a file using dd
.
The big difference between now and two years ago is that both the SSD and the HDD are using the ZFS filesystem instead of UFS.
Most of the SSD (except for swap) is part of the zpool
pool.
The zstorage
pool occupies the HDD.
The zroot
pool contains the root filesystem, and basically everything except
/home
, which is on the zstorage
pool.
In contrast to the pool on the SSD, that on the HDD is on a GELI encrypted partition.
SSD
First the write test to the SSD:
> dd if=/dev/zero of=/tmp/foo bs=10M count=1000 1000+0 records in 1000+0 records out 10485760000 bytes transferred in 1.898418 secs (5523418767 bytes/sec)
This is astonishingly fast; 5523 MB/s or 5267 MiB/s. To say that it is significantly faster than UFS would be an understatement.
I’m not sure is this is a meaningful test, but I would not know how to generate such huge amounts of data otherwise.
If I use /dev/random
as the source, throughput drops by an order of
magnitude.
Probably because of the need to generate random data.
By default, the ZFS cache (adaptive reactive cache; “ARC”) uses most of the free memory. On my machine, I’ve limited it to 2 GiB.
HDD
According to camcontrol identify ada0
:
pass0: <WDC WD4002FYYZ-01B7CB1 01.01M03> ACS-2 ATA SATA 3.x device pass0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) protocol ACS-2 ATA SATA 3.x device model WDC WD4002FYYZ-01B7CB1 firmware revision 01.01M03 serial number ******** WWN **************** additional product id cylinders 16383 heads 16 sectors/track 63 sector size logical 512, physical 512, offset 0 LBA supported 268435455 sectors LBA48 supported 7814037168 sectors PIO supported PIO4 DMA supported WDMA2 UDMA6 media RPM 7200
The test on the HDD:
> dd if=/dev/zero of=/home/rsmith/tmp/foo bs=10M count=1000 1000+0 records in 1000+0 records out 10485760000 bytes transferred in 54.703728 secs (191682730 bytes/sec)
This is 191.7 MB/s or 182.8 MiB/s.
Much faster than the last SATA 2 HDD’s that I tested.
But significantly below the 600 MB/s claimed by the pass0
device.
I suspect the encryption overhead plays a role in that.
Unfortunately I did not run the test with a UFS filesystem; that would have been interesting to see.
For comments, please send me an e-mail.
Related articles
- Writing speed on FreeBSD 12.1-STABLE amd64
- Writing speed on FreeBSD 9-RELEASE-p3 amd64
- Writing speed on FreeBSD 8.1-RELEASE amd64
- On Python speed
- FreeBSD 13.1 install on a Lenovo IdeaPad 5