Note that for maximum performance, it's recommended to have /var/lib/lxd on a btrfs filesystem or setup ZFS or LVM and configure LXD to use a ZFS pool or LVM VG. Source

Why is that? I.e. How will those file systems (on the host) equate to better container performance?

Is it computational performance, is it just reduced hard drive consumption because of copy-on-write, both, neither, or something else?

Edit 1

Thanks to @Sven for pointing out that "LVM VG" refers to Logical Volume Manager Volume Group.

  • 1
    VG = Volume Group. You use one or more physical volumes (PV) to create a VG and then create a logical volume (LV) on that VG. – Sven Feb 29 '16 at 9:39

In addition to what @Sven said; ZFS, btrfs and LVM all provide copy-on-write clone/snapshot features. This makes it very cheap storage and time-wise to spin up new containers. With an image stored on regular ext2-4 filesystem, LXD will have to copy all the data itself, which takes more time and storage.


First off, btrfs and ZFS offer features similar to LVM where space is offered not as a file but as a device with direct block device access.

When using disk image files (e.g. qcow), a file system operation in the container will be translated like this:

FS op.-> virtual block device -> FS op in the host on the container file 
     -> physical block device (or any number of  VFS layers like e.g. LVM)  

where the FS op on the container is a comparatively expensive operation. Using some kind of logical volume instead of a container file gets rid of this expensive FS operation:

FS op.-> virtual block device -> logical volume -> physical block device

where the logical volume operation is much cheaper than a file system operation.

  • I see what you are getting at, but could you add one or more example operations at each level, to provide a more concrete answer? E.g. At the file system operation in the host: seek to location XYZ in file and write ABC bytes. – pleasedesktop Feb 29 '16 at 11:01
  • When did Btrfs start providing "a device with direct block device access"? O_o – poige Dec 3 '16 at 7:18
  • btrfs doesn't seem to support yet to create block device inside its fs: btrfs.wiki.kernel.org/index.php/… – Mircea Vutcovici Dec 7 '16 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.