New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
How to avoid hd performance read/write hit with lxc/lxd ?
I am experimenting with running some websites in linux containers. There is a noticeable degradation of around 20-30% in disk performance inside containers using btrf. Can you plz guide me a way around this ?
I am mainly using the containers with the hope of easily backing up and migrating the websites.
Comments
It might be related to SWAP.
Small LXC won't be able to utilize full speed of a NVMe drive but should utilize HDD I/O fully.
Maybe try ext4 instead of btrf? Ext4 should be faster than btrf.
The actual performance loss on LXC compared to KVM is about 10 to 15%.
I am actually running the lxc inside a kvm could that be a cause? from the performance inside kvm to the performance inside lxc within kvm there is a 20% performance hit on the disk. Also, the only options i see in lxd are Dir, lvm, btrfs, ceph.
This typically isn't anything to do with lxc but with btrfs. You need to find the bottleneck.
Look at what file is being accessed to cause the I/O or whether it is a btrfs process (like cleaner). Disabling btrfs CoW sometimes helps. Disabling compression might/might not help. I do not put write-heavy databases on btrfs. I put them on an ext4 partition and bind-mount it into lxc, since backup of that should be done at application layer anyway.
This topic is what we ultimately spend the most effort in ... It's always changing goal how to drive the most I/O performance out of the system, and what is the relation (%) to raw performance to end user performance.
The full stack needs to be considered. It also wildly depends on the usage pattern
Then again, we don't run LXC nor Btrfs ... No idea how that compares, we've so far never considered Btrfs to be production ready so can't say anything about it sorry 🤷🤷
Btrfs is not the fastest filesystem by far. However it has many useful features to make up for that. If your main concern is speed, try the first two options instead. But I believe with "Dir" there won't be any snapshot support.
Thank u thank u I tried lvm & believe me the lxc container is showing even marginally better disk stats than the host I don't know how this is even possible but I am deploying it.
Drop hdd entirely. Insert 1024 GiB of DDR4 ram and operate from it. Never reboot. YOLO box.
dir is the last resort, pretty sure someone benchmark them somewhere too.