Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe disable CoW on Btrfs (and others) for Pack-files #110

Open
dev-zero opened this issue May 4, 2021 · 3 comments
Open

Maybe disable CoW on Btrfs (and others) for Pack-files #110

dev-zero opened this issue May 4, 2021 · 3 comments

Comments

@dev-zero
Copy link

dev-zero commented May 4, 2021

Modern filesystems like Btrfs do a Copy-on-write. When adding data to a large file this may lead to fragmentation, similar to what can be seen in virtual machine images. The object store should therefore probably detect these filesystems (btrfs, zfs) and disable CoW on the pack files, see also this stackexchange for a discussion on CoW for VM images.

Note: I have not benchmarked this yet.

@dev-zero
Copy link
Author

dev-zero commented May 4, 2021

For Btrfs (and also zfs) this is done with chattr +C file on the command line.

@giovannipizzi
Copy link
Member

Thanks for the report! It would be nice to have a way to test this - do you know if there is a way to have a Btrfs or zfs on GitHub Actions?

@dev-zero
Copy link
Author

dev-zero commented May 5, 2021

According to this GHA Community Question one should be able to create and mound a file-backed block device:

truncate -s 1g disk.img
mkfs.btrfs disk.img
losetup /dev/loop0 disk.img
mkdir disk
mount /dev/loop0 disk

... the last command depends on whether the kernel they use has btrfs-support built-in.
Only tested locally...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants