• 10 Posts
  • 1.54K Comments
Joined 3 years ago
cake
Cake day: July 7th, 2023

help-circle

  • I don’t think it could possibly be measured because it’s something like: (file size ÷ block size) * num_writes

    So it entire depends on the types of files, how often you’re utilizing writes to disk…etc. I just wouldn’t worry about it. If you REALLY want to estimate the tax: use iostat to check the number of writes on the drive in the last 24 hours, THEN enable online defrag and check it again in 24 hours. See what the difference is.

    It really doesn’t matter for HDD though. Barely probably matters for SSD.




  • There is no “normal” amount of fragmentation on modern filesystems that do things like CoW. That’s kind of the point.

    If you’re reading and writing large files with a consistent amount of I/O, you’re going to have a higher amount of fragmentation because of the nature of CoW. This is by design. This doesn’t mean anything is wrong with the filesystem, just that peak performance soon after writing is not achieved. Btrfs and ZFS do online defrag and deferred scheduling of tasks for it to allow for EVENTUAL consistency as far as contiguous block forms go. The more free space you have, the sooner it will become cleaner.