btrfs / btrfs-todo

An issues only repo to organize our TODO items
21 stars 2 forks source link

Detailed statistics output from scrub #56

Open jelazual opened 5 months ago

jelazual commented 5 months ago

It would be a useful option, for drive health diagnostics, especially with SSD, to be able to check the read performance and latency for the drive. Is it possible to create a table of read speeds when scrubbing a disk, and have that dumped to a file on another drive to be looked over, to see where performance has dropped?

SSDs especially are a black box with many mysteries in the way data is organized and read, and how long the data remains relevant. https://forum.level1techs.com/t/ssd-data-retention/205692/155 Scrolling to the lower posts in this topic, it becomes apparent that data can get slower to read over time with SSDs, but it's still unclear the mechanism of why I think. What we do know, however, is a drive can be made faster again by rewriting data in-place, at least in looking at file read benchmarks.

It would be good, I think, for scrub to be able to gather and dump detailed read performance statistics for drive health, and perhaps a refresh feature for SSDs to overwrite data beyond a certain performance threshold in-place to see increased drive performance again. But, I think refresh would also bear a lot of research to determine the most optimal way to measure a file or block's real-world performance, and when and how to rewrite that data in-place.

I don't know if it's really something to put in the filesystem, but I do think it might be worth considering, and I'm not aware of any linux utilities for this kind of maintenance, especially ones that can be discerning about rewrites to maintain a certain performance level without wear-leveling the drive into dirt.