I hunted around for a while until I finally just searched for the name of the
pegged process, btrfs-endio-wri, and cpu time. It turns out, the btrfs
folks have a page detailing a
list of current "gotchas" btrfs has. This issue was one of them. They describe
it as <pre> Files with a lot of random writes can become heavily fragmented
(10000+ extents) causing trashing on HDDs and excessive multi-second spikes of
CPU load on systems with an SSD or large amount a RAM. … Symptoms include
btrfs-transacti and btrfs-endio-wri taking up a lot of CPU time (in spikes,
possibly triggered by syncs). You can use filefrag to locate heavily fragmented
files. </pre>
One of the best parts of rsync is that is syncs deltas instead of resyncing the
entire file. What does that result in? Lots of little random writes. Sounds
like a match to me.
To fix this, I defragged all of /home/ (with compression=lzo of course :)
), and remounted using the autodefrag option.
Now I can run rsync with no problems.
One last thing to note. Their gotchas page says that once they’ve worked out a
few potential kinks with the autodefrag mount option, they’ll make it the
default, which should prevent this from being an issue in future versions.
Category:Linux
Category:Btrfs
Category:Storage
Category:RAID