You are not logged in.

#1 2022-02-11 18:07:44

stri
Member
Registered: 2014-06-09
Posts: 75

performance of btrfs for vm guest images

I read a lot of posts about performance issues with copy-on-write (cow) if virtual machine images files are stored on btrfs (which can be avoided by disabling cow for certain data blocks, but it's not the topic of the question).

I don't want to have btrfs on the host, but I'm wondering if at least I can take advantage of btrfs snapshotting from within the guest? My question is: are there any performance issues when the GUEST filesystem is btrfs, sitting on a non-cow host, for example, an ext4 host filesystem? What I mean is: does the fact that the cow process is controlled by the guest and happens within a disk image lying on an (e.g.) ext4 host disk have any of the same performance drawbacks that would occur if the host was btrfs?

Thanks for your help!

Offline

#2 2022-02-11 18:28:31

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: performance of btrfs for vm guest images

According to BTRFS wiki, snapshots work by use of btrfs's copy-on-write behaviour. There is really no point to use snapshot if you don't use COW. Besides virtual machines like Virtualbox allows you to take a snapshot of the system anyway so why not just use the VM's builtin snapshot capabilities?

Offline

#3 2022-02-11 18:45:36

stri
Member
Registered: 2014-06-09
Posts: 75

Re: performance of btrfs for vm guest images

But I *do* want to use cow. The question is if there is any performance difference in doing cow within the guest, as opposed to on the host filesystem.

I use Qemu/kvm and want to use raw images for portability (no built-in snapshotting for raw images (last time I checked...).

I could send out the btrfs snapshots from the guest to the host or other machine, which could have a separate btrfs partition for receiving snapshots. Snapshot frequency would be about once per day, and only for data partitions (no root filesystem snapshots necesssary)

Thanks again for your help!

Last edited by stri (2022-02-11 18:47:15)

Offline

#4 2022-02-11 19:02:19

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,687

Re: performance of btrfs for vm guest images

But I *do* want to use cow. The question is if there is any performance difference in doing cow within the guest, as opposed to on the host filesystem.

I see. I misunderstood. That I don't know to answer as I've never tried it. Just bear in mind, as has been reiterated many times, that a btrfs snapshot is not a backup and in my point of view, if you care for your data, I would rather propose a proper backup like rsync..

Offline

#5 2022-02-11 19:28:27

stri
Member
Registered: 2014-06-09
Posts: 75

Re: performance of btrfs for vm guest images

Now that you mention rsync, I think rsync is a good example to motivate my original question further: with rsync, I can see immediately that doing it from the guest is better: the guest sees the filesystem, sees which files have changed and transfers only those that have. Using rsync on the host would result in transferrring the entire image file, even if just a tiny file within had changed.

But with btrfs it's more subtle since it acts on a lower level (block level? - I don't really underestand). So I don't know.

Offline

Board footer

Powered by FluxBB