[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mixing HDD and SSD in lvm



Hi,

On Tue, Feb 06, 2024 at 12:18:26PM +0100, Kamil Jońca wrote:
> My main concern is if speed differences between SSD and HDD in one lvm
> can make any problems.

The default allocation policy for LVM ("normal") is to use an
arbitrary PV that has space. So this means that unless you say so,
you will not know which PV the extents for any given LV will go to.
Assuming you create an LV that is not larger than an entire PV, all
of it will end up on one or the other and will have the same
performance profile.

If you don't like that you can specify which PV to put it on, at
lvcreate time.

If you tell LVM to stripe extents between the two PVs then it will
not cause a problem, but I expect performance to be impacted,
possibly capped at that of the slowest PV.

Do check your device's sector size. I have been having problems
with mixed 512 vs 4K devices. That is only when the 4K device is
formatted to only do 4K though; most "Advanced Format" devices can
do both 512b and 4K.

If you are trying to do tiered storage you may have more luck with
dm-cache, zfs, bcache or (the only recently upstreamed) bcachefs.

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting


Reply to: