Disk performance on LXD containers vs Debian host

Hi there,

I ran some DISK benchmarks using dd utility on LXD (ubuntu) container and compared it’s performance with the host Debian OS. I see a very large difference between the latency in creating files on LXD container Vs. that on the host OS. The host performs way better than LXDs. Any insights as to what is causing that? What specifics of LXD container filesystem is giving such a large overhead ?

That’s almost certainly dependent on your storage setup in LXD.
Can you show lxc storage list and lxc storage show NAME for any of those entries?

Sorry, but looks like my containers are running into constant error with getting restarted now. Everytime I start the instance, it shows error LXD shutting down

The lxc storage list shows btrfs driver

Ok, so there’s a good chance that your performance issues just come down to you using a loop backed btrfs pool. Effectively causing every write in a container to have to go through two filesystems.

Either using dir which will use the same storage as your host system or using btrfs or others with a dedicated block device would give you far better performance.

1 Like

ah! I see, thank you so much for the insight