BTRFS vs EXT4

Dejo aquí un simple test FIO, el mismo test en el mismo disco, montado y formateado con btrfs y ext4

Lo dejo como log y para que se vea la diferencia, el por que de esta diferencia se puede explicar pero hoy no tengo tiempo.

El disco usado Crucial p510 nuevo de paquete

 

BTRFS fio test:

 

fio --filename=fio-test --size=2G --direct=1 --rw=randrw --bs=4k --ioengine=libaio --iodepth=64 --numjobs=16 --group_reporting --name=iops-max-test
iops-max-test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64
...
fio-3.41
Starting 16 processes
iops-max-test: Laying out IO file (1 file / 2048MiB)
Jobs: 16 (f=14): [m(3),f(1),m(10),f(1),m(1)][100.0%][r=400MiB/s,w=399MiB/s][r=102k,w=102k IOPS][eta 00m:00s]
iops-max-test: (groupid=0, jobs=16): err= 0: pid=4601: Thu Jan 29 15:35:27 2026
  read: IOPS=89.2k, BW=348MiB/s (365MB/s)(16.0GiB/47011msec)
    slat (usec): min=2, max=98009, avg=69.69, stdev=147.86
    clat (usec): min=42, max=105468, avg=5680.94, stdev=3251.11
     lat (usec): min=45, max=105557, avg=5750.62, stdev=3288.03
    clat percentiles (msec):
     |  1.00th=[    4],  5.00th=[    5], 10.00th=[    5], 20.00th=[    5],
     | 30.00th=[    5], 40.00th=[    5], 50.00th=[    5], 60.00th=[    6],
     | 70.00th=[    6], 80.00th=[    6], 90.00th=[    7], 95.00th=[   10],
     | 99.00th=[   22], 99.50th=[   23], 99.90th=[   26], 99.95th=[   27],
     | 99.99th=[  103]
   bw (  KiB/s): min=90528, max=444728, per=100.00%, avg=356839.00, stdev=6293.15, samples=1502
   iops        : min=22632, max=111182, avg=89209.75, stdev=1573.29, samples=1502
  write: IOPS=89.3k, BW=349MiB/s (366MB/s)(16.0GiB/47011msec); 0 zone resets
    slat (usec): min=14, max=96948, avg=106.71, stdev=186.90
    clat (nsec): min=871, max=103573k, avg=5606631.51, stdev=3226988.42
     lat (usec): min=27, max=103633, avg=5713.34, stdev=3283.39
    clat percentiles (msec):
     |  1.00th=[    4],  5.00th=[    5], 10.00th=[    5], 20.00th=[    5],
     | 30.00th=[    5], 40.00th=[    5], 50.00th=[    5], 60.00th=[    6],
     | 70.00th=[    6], 80.00th=[    6], 90.00th=[    7], 95.00th=[   10],
     | 99.00th=[   22], 99.50th=[   23], 99.90th=[   26], 99.95th=[   26],
     | 99.99th=[  101]
   bw (  KiB/s): min=91952, max=446992, per=100.00%, avg=357148.75, stdev=6305.30, samples=1502
   iops        : min=22988, max=111748, avg=89287.19, stdev=1576.32, samples=1502
  lat (nsec)   : 1000=0.01%
  lat (usec)   : 2=0.01%, 4=0.01%, 50=0.01%, 100=0.01%, 250=0.01%
  lat (usec)   : 500=0.01%, 750=0.01%, 1000=0.03%
  lat (msec)   : 2=0.05%, 4=4.13%, 10=91.11%, 20=2.64%, 50=2.01%
  lat (msec)   : 100=0.01%, 250=0.01%
  cpu          : usr=2.01%, sys=27.27%, ctx=14782061, majf=0, minf=193
  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=4192550,4196058,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=348MiB/s (365MB/s), 348MiB/s-348MiB/s (365MB/s-365MB/s), io=16.0GiB (17.2GB), run=47011-47011msec
  WRITE: bw=349MiB/s (366MB/s), 349MiB/s-349MiB/s (366MB/s-366MB/s), io=16.0GiB (17.2GB), run=47011-47011msec



 

# fio --name rw --rw rw --size 10G
rw: (g=0): rw=rw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.41
Starting 1 process
rw: Laying out IO file (1 file / 10240MiB)
Jobs: 1 (f=1): [M(1)][100.0%][r=1523MiB/s,w=1523MiB/s][r=390k,w=390k IOPS][eta 00m:00s]
rw: (groupid=0, jobs=1): err= 0: pid=4810: Thu Jan 29 15:36:09 2026
  read: IOPS=418k, BW=1634MiB/s (1713MB/s)(5123MiB/3136msec)
    clat (nsec): min=233, max=3887.3k, avg=1015.23, stdev=23344.54
     lat (nsec): min=246, max=3887.3k, avg=1031.20, stdev=23344.62
    clat percentiles (nsec):
     |  1.00th=[    253],  5.00th=[    282], 10.00th=[    338],
     | 20.00th=[    398], 30.00th=[    414], 40.00th=[    430],
     | 50.00th=[    450], 60.00th=[    474], 70.00th=[    524],
     | 80.00th=[    652], 90.00th=[    788], 95.00th=[    844],
     | 99.00th=[   1336], 99.50th=[   1672], 99.90th=[   8640],
     | 99.95th=[  56064], 99.99th=[1138688]
   bw (  MiB/s): min= 1519, max= 1780, per=100.00%, avg=1640.79, stdev=106.94, samples=6
   iops        : min=389044, max=455704, avg=420041.67, stdev=27377.13, samples=6
  write: IOPS=418k, BW=1632MiB/s (1711MB/s)(5117MiB/3136msec); 0 zone resets
    clat (nsec): min=836, max=371633, avg=1106.25, stdev=684.75
     lat (nsec): min=858, max=371656, avg=1128.75, stdev=688.75
    clat percentiles (nsec):
     |  1.00th=[  868],  5.00th=[  900], 10.00th=[  908], 20.00th=[  916],
     | 30.00th=[  940], 40.00th=[  964], 50.00th=[  996], 60.00th=[ 1032],
     | 70.00th=[ 1096], 80.00th=[ 1192], 90.00th=[ 1400], 95.00th=[ 1624],
     | 99.00th=[ 2288], 99.50th=[ 2672], 99.90th=[ 6496], 99.95th=[10432],
     | 99.99th=[23680]
   bw (  MiB/s): min= 1522, max= 1776, per=100.00%, avg=1639.30, stdev=106.03, samples=6
   iops        : min=389796, max=454896, avg=419661.33, stdev=27143.76, samples=6
  lat (nsec)   : 250=0.31%, 500=32.76%, 750=10.03%, 1000=32.17%
  lat (usec)   : 2=23.64%, 4=0.90%, 10=0.12%, 20=0.04%, 50=0.01%
  lat (usec)   : 100=0.01%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.01%, 4=0.01%
  cpu          : usr=17.70%, sys=81.63%, ctx=90, majf=0, minf=12
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
     issued rwts: total=1311533,1309907,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=1634MiB/s (1713MB/s), 1634MiB/s-1634MiB/s (1713MB/s-1713MB/s), io=5123MiB (5372MB), run=3136-3136msec
  WRITE: bw=1632MiB/s (1711MB/s), 1632MiB/s-1632MiB/s (1711MB/s-1711MB/s), io=5117MiB (5365MB), run=3136-3136msec

 

EXT4 Fio Test

 

# fio --filename=fio-test --size=2G --direct=1 --rw=randrw --bs=4k --ioengine=libaio --iodepth=64 --numjobs=16 --group_reporting --name=iops-max-test
iops-max-test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64
...
fio-3.41
Starting 16 processes
iops-max-test: Laying out IO file (1 file / 2048MiB)
Jobs: 16 (f=16): [m(16)][100.0%][r=2170MiB/s,w=2169MiB/s][r=556k,w=555k IOPS][eta 00m:00s]
iops-max-test: (groupid=0, jobs=16): err= 0: pid=5065: Thu Jan 29 15:37:29 2026
  read: IOPS=550k, BW=2150MiB/s (2255MB/s)(16.0GiB/7617msec)
    slat (nsec): min=917, max=626988, avg=3430.31, stdev=5314.23
    clat (usec): min=29, max=11822, avg=815.61, stdev=529.37
     lat (usec): min=30, max=11823, avg=819.04, stdev=529.85
    clat percentiles (usec):
     |  1.00th=[  176],  5.00th=[  269], 10.00th=[  334], 20.00th=[  437],
     | 30.00th=[  523], 40.00th=[  603], 50.00th=[  685], 60.00th=[  791],
     | 70.00th=[  922], 80.00th=[ 1106], 90.00th=[ 1434], 95.00th=[ 1762],
     | 99.00th=[ 2671], 99.50th=[ 3228], 99.90th=[ 5014], 99.95th=[ 5538],
     | 99.99th=[ 7177]
   bw (  MiB/s): min= 2023, max= 2227, per=100.00%, avg=2150.98, stdev= 3.16, samples=240
   iops        : min=518012, max=570160, avg=550649.47, stdev=810.10, samples=240
  write: IOPS=551k, BW=2152MiB/s (2256MB/s)(16.0GiB/7617msec); 0 zone resets
    slat (nsec): min=994, max=1225.1k, avg=3859.43, stdev=5879.37
    clat (nsec): min=375, max=11896k, avg=1030567.39, stdev=561966.02
     lat (usec): min=8, max=11898, avg=1034.43, stdev=562.38
    clat percentiles (usec):
     |  1.00th=[   99],  5.00th=[  347], 10.00th=[  537], 20.00th=[  660],
     | 30.00th=[  742], 40.00th=[  832], 50.00th=[  922], 60.00th=[ 1012],
     | 70.00th=[ 1156], 80.00th=[ 1352], 90.00th=[ 1663], 95.00th=[ 1991],
     | 99.00th=[ 2966], 99.50th=[ 3720], 99.90th=[ 5211], 99.95th=[ 5932],
     | 99.99th=[ 7767]
   bw (  MiB/s): min= 2026, max= 2229, per=100.00%, avg=2152.77, stdev= 3.22, samples=240
   iops        : min=518865, max=570792, avg=551109.67, stdev=824.81, samples=240
  lat (nsec)   : 500=0.01%
  lat (usec)   : 4=0.01%, 10=0.01%, 20=0.04%, 50=0.19%, 100=0.31%
  lat (usec)   : 250=3.02%, 500=14.54%, 750=25.47%, 1000=23.11%
  lat (msec)   : 2=29.29%, 4=3.69%, 10=0.34%, 20=0.01%
  cpu          : usr=9.44%, sys=28.00%, ctx=4630783, majf=0, minf=153
  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=4192550,4196058,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=2150MiB/s (2255MB/s), 2150MiB/s-2150MiB/s (2255MB/s-2255MB/s), io=16.0GiB (17.2GB), run=7617-7617msec
  WRITE: bw=2152MiB/s (2256MB/s), 2152MiB/s-2152MiB/s (2256MB/s-2256MB/s), io=16.0GiB (17.2GB), run=7617-7617msec

Disk stats (read/write):
  nvme1n1: ios=4129380/4145271, sectors=33035040/36253288, merge=0/6, ticks=3275406/4131695, in_queue=7407102, util=89.51%
  
 # fio --name rw --rw rw --size 10G
rw: (g=0): rw=rw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.41
Starting 1 process
rw: Laying out IO file (1 file / 10240MiB)
Jobs: 1 (f=1): [M(1)][-.-%][r=1878MiB/s,w=1876MiB/s][r=481k,w=480k IOPS][eta 00m:00s]
rw: (groupid=0, jobs=1): err= 0: pid=5125: Thu Jan 29 15:38:03 2026
  read: IOPS=488k, BW=1907MiB/s (2000MB/s)(5123MiB/2686msec)
    clat (nsec): min=231, max=4875.7k, avg=1022.86, stdev=26230.76
     lat (nsec): min=247, max=4875.8k, avg=1039.04, stdev=26230.81
    clat percentiles (nsec):
     |  1.00th=[   258],  5.00th=[   286], 10.00th=[   366], 20.00th=[   390],
     | 30.00th=[   402], 40.00th=[   414], 50.00th=[   422], 60.00th=[   434],
     | 70.00th=[   446], 80.00th=[   466], 90.00th=[   532], 95.00th=[   716],
     | 99.00th=[ 16768], 99.50th=[ 18304], 99.90th=[ 34048], 99.95th=[ 54528],
     | 99.99th=[790528]
   bw (  MiB/s): min= 1640, max= 2250, per=100.00%, avg=1930.54, stdev=269.78, samples=5
   iops        : min=420064, max=576100, avg=494218.80, stdev=69063.19, samples=5
  write: IOPS=488k, BW=1905MiB/s (1998MB/s)(5117MiB/2686msec); 0 zone resets
    clat (nsec): min=441, max=457616, avg=778.90, stdev=1412.63
     lat (nsec): min=463, max=457637, avg=800.30, stdev=1413.59
    clat percentiles (nsec):
     |  1.00th=[  556],  5.00th=[  572], 10.00th=[  580], 20.00th=[  596],
     | 30.00th=[  612], 40.00th=[  628], 50.00th=[  644], 60.00th=[  668],
     | 70.00th=[  692], 80.00th=[  780], 90.00th=[  972], 95.00th=[ 1064],
     | 99.00th=[ 3472], 99.50th=[ 3792], 99.90th=[ 5472], 99.95th=[13632],
     | 99.99th=[59136]
   bw (  MiB/s): min= 1643, max= 2240, per=100.00%, avg=1928.76, stdev=267.83, samples=5
   iops        : min=420716, max=573634, avg=493763.20, stdev=68563.63, samples=5
  lat (nsec)   : 250=0.22%, 500=43.66%, 750=43.34%, 1000=7.62%
  lat (usec)   : 2=3.29%, 4=0.93%, 10=0.16%, 20=0.62%, 50=0.12%
  lat (usec)   : 100=0.02%, 250=0.01%, 500=0.01%, 750=0.01%, 1000=0.01%
  lat (msec)   : 2=0.01%, 4=0.01%, 10=0.01%
  cpu          : usr=19.89%, sys=63.72%, ctx=3046, majf=0, minf=10
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
     issued rwts: total=1311533,1309907,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=1907MiB/s (2000MB/s), 1907MiB/s-1907MiB/s (2000MB/s-2000MB/s), io=5123MiB (5372MB), run=2686-2686msec
  WRITE: bw=1905MiB/s (1998MB/s), 1905MiB/s-1905MiB/s (1998MB/s-1998MB/s), io=5117MiB (5365MB), run=2686-2686msec

Disk stats (read/write):
  nvme1n1: ios=37690/20969, sectors=9636664/5366304, merge=0/2, ticks=4435/37122, in_queue=41557, util=54.00%

 

Si, podemos decir que es un poco escueto, pero es el mismo comando en 2 sistemas de ficheros distintos con algunas diferencias.

btrfs vs ext4

Todo esto sin ningún tipo de tuning, 

El problema viene de que tengo un sistema en el que monte luks2 y btrfs por encima y el rendimiento es bastante peor si probamos con FIO, luego en el día a día no se nota, ,pero fue en un samasung pro 580, luego hice las pruebas en un P510 de crucial sin luks y también se ha notado.

 

¿ Entonces por que uso btrfs si es más lento que ext4 ? 

No tengo ninguna necesidad, pero tal vez un día vaya a usar los snapshots antes de actualizar y en el día a día no se nota ninguna diferencia real.

Y arrancando el sistema no se si se note diferencia, pero todo es probar.