Hacker News new | ask | show | jobs
by simoncion 72 days ago
The lightly-edited transcript, relocated to a second comment to maybe avoid folding up the report:

  # lvcreate --size 3T --name testlv --stripes=2 testvg
    Using default stripesize 64.00 KiB.
    Logical volume "testlv" created.
  # mkfs.btrfs /dev/mapper/testvg-testlv
  btrfs-progs v7.1
  See https://btrfs.readthedocs.io for more information.
  <extra crap removed>
  # mount -o compress-force /dev/mapper/testvg-testlv /mnt/test/
  # btrfs fi usage
      Device size:     3.00TiB
      Device allocated:     2.02GiB
      Device unallocated:     3.00TiB
      Device missing:       0.00B
      Device slack:       0.00B
      Used:    320.00KiB
      Free (estimated):     3.00TiB (min: 1.50TiB)
  <extra crap removed>
  # dd if=/dev/zero of=/mnt/test/5TBFile bs=4MiB count=5TiB
  1310720+0 records in
  1310720+0 records out
  5497558138880 bytes (5.5 TB, 5.0 TiB) copied, 2510.22 s, 2.2 GB/s
  # /usr/bin/time --format='** fi sync %e' btrfs fi sync /mnt/test
  ** fi sync 0.00
  # btrfs fi df /mnt/test/ | grep Data
  Data, single: total=160.00GiB, used=160.00GiB
  # /usr/bin/time --format='** totalTime %e' bash -c "
    /usr/bin/time --format='** 20gbTime %e' bash -c 'dd if=/dev/zero of=/mnt/test/20GBFile bs=4MiB count=20GiB status=none; du -h /mnt/test/20GBFile; rm /mnt/test/20GBFile'&
    /usr/bin/time --format='** 10gbTime %e' bash -c 'dd if=/dev/zero of=/mnt/test/10GBFile bs=4MiB count=10GiB status=none;  du -h /mnt/test/10GBFile; rm /mnt/test/10GBFile'&
    wait"
  10G /mnt/test/10GBFile
  ** 10gbTime 2.42
  20G /mnt/test/20GBFile
  ** 20gbTime 4.95
  ** totalTime 4.95
  # date
  Sun Sep 20 10:19:46 PM PDT 2026
  # /usr/bin/time --format='** totalTime %e' bash -c "
    /usr/bin/time --format='** 05tbTime %e' rm /mnt/test/5TBFile &
    sleep 5 # It takes a few seconds for the delete to start making things slow when the file has been compressed. The operations on the 10GB file will complete in a normal amount of time if this sleep isn't present.
    /usr/bin/time --format='** 20gbTime %e' bash -c 'dd if=/dev/zero of=/mnt/test/20GBFile bs=4MiB count=20GiB status=none; du -h /mnt/test/20GBFile; rm /mnt/test/20GBFile'&
    /usr/bin/time --format='** 10gbTime %e' bash -c 'dd if=/dev/zero of=/mnt/test/10GBFile bs=4MiB count=10GiB status=none;  du -h /mnt/test/10GBFile; rm /mnt/test/10GBFile'&
    wait"
  10G /mnt/test/10GBFile
  ** 10gbTime 183.64
  20G /mnt/test/20GBFile
  ** 20gbTime 259.47
  ** 05tbTime 1026.21
  ** totalTime 1026.22
  # date ; /usr/bin/time --format='** 20gbTime2 %e' bash -c 'dd if=/dev/zero of=/mnt/test/20GBFile bs=4MiB count=20GiB status=none; du -h /mnt/test/20GBFile; rm /mnt/test/20GBFile' ; date
  Sun Sep 20 10:36:52 PM PDT 2026
  20G /mnt/test/20GBFile
  ** 20gbTime2 23.04
  Sun Sep 20 10:37:15 PM PDT 2026
1 comments

Thank you, its useful finding that only transparently compressed btrfs is affected.