diff --git a/engine/userguide/storagedriver/btrfs-driver.md b/engine/userguide/storagedriver/btrfs-driver.md index 5d8dae05cc..0e25217a15 100644 --- a/engine/userguide/storagedriver/btrfs-driver.md +++ b/engine/userguide/storagedriver/btrfs-driver.md @@ -260,6 +260,7 @@ daemon` at startup, or adding it to the `DOCKER_OPTS` line to the Docker config Your Docker host is now configured to use the `btrfs` storage driver. + ## Btrfs and Docker performance There are several factors that influence Docker's performance under the `btrfs` @@ -311,6 +312,24 @@ any of the potential overheads introduced by thin provisioning and copy-on-write. For this reason, you should place heavy write workloads on data volumes. +- **Balance BTRFS**. Enable a cronjob to rebalance your BTRFS devices. e.g. +Spread the subvolume's blocks evenly across your raid devices, and reclaim +unused blocks. Without doing this, snapshots and subvolumes that docker +removes will leave allocated blocks fillingup the BTRFS root volume. Once full +you won't be able to re-balance, resulting in a potentially unrecoverable +state without adding an additional storage device. If you would rather not +automate this with crond, another option is to run a re-balance manually +outside peak use times since the operation can be disk I/O intensive. This +command will claim all chunks that are 1% used or less: + + $ sudo btrfs filesystem balance start -dusage=1 /var/lib/docker + + Dumping filters: flags 0x1, state 0x0, force is off + DATA (flags 0x2): balancing, usage=1 + Done, had to relocate 673 out of 842 chunks + +More information on this topic can be read on the [BTRFS Wiki](https://btrfs.wiki.kernel.org/index.php/Balance_Filters#Balancing_to_fix_filesystem_full_errors). + ## Related Information * [Understand images, containers, and storage drivers](imagesandcontainers.md)