Files with a lot of random writes can become heavily fragmented (10000+
extents) causing thrashing on HDDs and excessive multi-second spikes of
CPU load on systems with an SSD or large amount a RAM.
- On servers and workstations this affects databases and virtual machine images.
- The nodatacow mount option may be of use here, with associated gotchas.
- On desktops this primarily affects application databases
(including Firefox and Chromium profiles, GNOME Zeitgeist, Ubuntu
Desktop Couch, Banshee, and Evolution's datastore.)
- Workarounds include manually defragmenting your home directory
using btrfs fi defragment. Auto-defragment (mount option autodefrag)
should solve this problem in 3.0.
- 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 (may not work correctly
with compression).