Merge pull request #960 from charlescva/patch-1

Update btrfs-driver.md for reclaiming blocks
This commit is contained in:
Misty Stanley-Jones 2016-12-28 16:41:32 -08:00 committed by GitHub
commit 88d41de994
1 changed files with 19 additions and 0 deletions

View File

@ -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)