btrfs fsync() is extremely slow
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dpkg (Debian) |
Fix Released
|
Unknown
|
|||
dpkg (Ubuntu) |
Triaged
|
Medium
|
Unassigned | ||
Bug Description
Installation and upgrades on btrfs are *extremely* slow. This is because dpkg makes extensive fsync() calls to make sure that a power loss in the middle of an operation does not leave the system in a broken state. These calls have a significant performance penalty on other filesystems ( such as ext[234] ), but on btrfs, the penalty is multiple orders of magnitude.
As a workaround, you can use the eatmydata package/command around dpkg/apt-get to disable the fsync() calls and restore good performance during upgrades, at the risk of hosing the system if it crashes. The apt-btrfs-snapshot package will have apt make a snapshot before it begins an upgrade so that if things do go wrong, you can at least roll back to the snapshot.
affects: | ubuntu → btrfs-tools (Ubuntu) |
affects: | linux-meta (Ubuntu) → linux (Ubuntu) |
tags: | added: patch |
summary: |
- [Maverick/Natty] btrfs is extremely slow + btrfs fsync() is extremely slow |
description: | updated |
tags: | added: oneiric |
tags: | added: precise |
tags: | added: dpkg |
Changed in linux (Ubuntu): | |
status: | Incomplete → Confirmed |
tags: | added: bot-stop-nagging |
tags: | added: utopic |
tags: | removed: maverick natty oneiric |
no longer affects: | linux (Ubuntu Maverick) |
Changed in dpkg (Debian): | |
status: | Unknown → Fix Released |
I can confirm the same issue; installation via the alpha 2 32bit alternate media takes ~2 hours when installing to a btrfs partition, compared to ~15 minutes to ext4. I'm not sure that system specs are necessary, because I don't think this is a bug (or if it is, it should be addressed upstream).
There's an old thread on the linux-btrfs list[1] which mentions a similar problem, so perhaps btrfs' performance characteristics are unfavourable towards file activity related to package unpacking/ installation.
[1] http://<email address hidden> /msg03104. html