I tested myself benchmark of zfs vs. btrfs in two same VM in my same hardware (a single SSD). Both filesystems are running in Linux Kernel 5.17
Copy (Read and Write) speed test with zfs (default compression lz4) in the real world. (I can not change lz4 to zstd because it crashes grub after reboot, but lz4 would be bit faster than zstd)
- Copy speed test of ZFS (Compression LZ4)
❯ sudo rsync -ah --progress /home/test/Desktop/backup /opt/backup_copy
sending incremental file list
backup
4,19G 100% 456,51MB/s 0:00:08 (xfr#1, to-chk=0/1)
❯ sudo rsync -ah --progress /home/test/Desktop/backup /opt/backup_copy1
sending incremental file list
backup
4,19G 100% 653,51MB/s 0:00:05 (xfr#1, to-chk=0/1)
- Copy speed test of BTRFS (Compression zstd)
❯ sudo rsync -ah --progress /home/test/Desktop/backup /opt/backup_copy
sending incremental file list
backup
4.19G 100% 598.44MB/s 0:00:06 (xfr#1, to-chk=0/1)
❯ sudo rsync -ah --progress /home/test/Desktop/backup /opt/backup_copy1
sending incremental file list
backup
4.19G 100% 844.77MB/s 0:00:04 (xfr#1, to-chk=0/1)
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --bs=4k --iodepth=64 --readwrite=randrw --rwmixread=75 --size=4G --filename=testfile
test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64
fio-3.29
Starting 1 process
Jobs: 1 (f=1): [m(1)][97.1%][r=110MiB/s,w=36.3MiB/s][r=28.1k,w=9304 IOPS][eta 00m:02s]
test: (groupid=0, jobs=1): err= 0: pid=194869: Sun Apr 24 12:46:52 2022
read: IOPS=11.8k, BW=46.2MiB/s (48.4MB/s)(3070MiB/66495msec)
bw ( KiB/s): min=35328, max=120664, per=98.37%, avg=46506.10, stdev=13001.85, samples=132
iops : min= 8832, max=30166, avg=11626.46, stdev=3250.46, samples=132
write: IOPS=3950, BW=15.4MiB/s (16.2MB/s)(1026MiB/66495msec); 0 zone resets
bw ( KiB/s): min=12064, max=38680, per=98.39%, avg=15545.64, stdev=4259.67, samples=132
iops : min= 3016, max= 9670, avg=3886.36, stdev=1064.90, samples=132
cpu : usr=1.88%, sys=36.05%, ctx=116626, majf=0, minf=8
IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
issued rwts: total=785920,262656,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=64
Run status group 0 (all jobs):
READ: bw=46.2MiB/s (48.4MB/s), 46.2MiB/s-46.2MiB/s (48.4MB/s-48.4MB/s), io=3070MiB (3219MB), run=66495-66495msec
WRITE: bw=15.4MiB/s (16.2MB/s), 15.4MiB/s-15.4MiB/s (16.2MB/s-16.2MB/s), io=1026MiB (1076MB), run=66495-66495msec
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --bs=4k --iodepth=64 --readwrite=randrw --rwmixread=75 --size=4G --filename=testfile
test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64
fio-3.29
Starting 1 process
test: Laying out IO file (1 file / 4096MiB)
Jobs: 1 (f=1): [m(1)][100.0%][r=139MiB/s,w=45.8MiB/s][r=35.7k,w=11.7k IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=24711: Sun Apr 24 12:40:16 2022
read: IOPS=34.7k, BW=135MiB/s (142MB/s)(3070MiB/22660msec)
bw ( KiB/s): min=129624, max=149544, per=100.00%, avg=138802.58, stdev=4058.99, samples=45
iops : min=32406, max=37386, avg=34700.60, stdev=1014.75, samples=45
write: IOPS=11.6k, BW=45.3MiB/s (47.5MB/s)(1026MiB/22660msec); 0 zone resets
bw ( KiB/s): min=42672, max=49464, per=100.00%, avg=46384.73, stdev=1385.39, samples=45
iops : min=10668, max=12366, avg=11596.16, stdev=346.36, samples=45
cpu : usr=3.85%, sys=87.35%, ctx=3168, majf=0, minf=6
IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
issued rwts: total=785920,262656,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=64
Run status group 0 (all jobs):
READ: bw=135MiB/s (142MB/s), 135MiB/s-135MiB/s (142MB/s-142MB/s), io=3070MiB (3219MB), run=22660-22660msec
WRITE: bw=45.3MiB/s (47.5MB/s), 45.3MiB/s-45.3MiB/s (47.5MB/s-47.5MB/s), io=1026MiB (1076MB), run=22660-22660msec