On Tue, Mar 31, 2020 at 1:17 PM Roman Mamedov <rm@xxxxxxxxxxx> wrote: > > On Tue, 31 Mar 2020 13:01:09 -0400 > Eli V <eliventer@xxxxxxxxx> wrote: > > > Another option is to put the 12TB drives in an mdadm RAID, and then > > use the mdadm raid & the ssd for btrfs RAID1 metadata, with SINGLE > > data on the the array. Currently, this will make roughly half of the > > meta data lookups run at SSD speed, but there is a pending patch to > > allow all the metadata reads to go to the SSD. This option is, of > > course, only useful for speeding up metadata operations. It can make > > large btrfs filesystems feel much more responsive in interactive use > > however. > > If you're not taking advantage of Btrfs-side features for RAID, then might as > well run LVM Cache on top of mdadm, and then Btrfs on top of the > cached LV. > https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/lvm_cache_volume_creation > https://lukas.zapletalovi.com/2019/05/lvm-cache-in-six-easy-steps.html > > Or Bcache, which is the same concept, but I do not suggest it over LVM cache > due to perceived lower code quality, i.e. many data loss bugs, at least in the > past. And as the 2nd article mentions, you can't un-bcache a block device, > even if the cache device is disabled, the metadata cannot be removed. Unlike > LVM where it is easy to switch back an LV to a plain uncached one. > > -- > With respect, > Roman Yes using lvm cache is an option, and will give you actual caching of the data files as well. However, in my experience it doesn't do much caching of metadata so using it on large filesystems doesn't seem to improve interactive usage much at all, i.e. ls -l, or btrfs filesystem usage etc. As to the question of "How do you restrict specific device for metadata only?" With btrfs metadata as RAID1 and data as SINGLE, and the mdadm array being much larger then the SSD, all data allocations will naturally go to the mdadm array, and all metadata writes will go to both the SSD and the array. Currently, the metadata reads will be balanced across the 2 devices based on PID. Once the btrfs readmirror patches are merged then you'll be able to have all the metadata reads go to just the SSD.
