1

I'm using Ubuntu 16.04.4 and it's running on a VM. The disk that has the origin data has an I/O limit on 1MB/s and disk for cache has no limit. I have followed the guide at fibervillage to create the LVM and succeeded without errors, with the modification to cachemode writeback, and I also did try writethrough just to try.

When the LV is without cache I got the expected behavior with 1MB transfer rate, But when I added the cahepool to the origin LV I do not see any performance enhancement at all. But creating a LV on the same disk were the cache pool is I get way faster transfer rate. I mounted all volumes in /etc/fstab with sync,dirsync options to avoid any other caching.

1
  • 1
    Maybe you are using kernel version before 4.12? Take a look at this article, performance improves a lot since Linux kernel 4.12.
    – cyfdecyf
    Jul 30, 2018 at 5:09

1 Answer 1

0

LVM cache works for reading by keeping track of accessed blocks and it only moves the content to cache when the blocks have been accessed many enough times. Unfortunately, the LVM cache is not tunable so you cannot make the cache filling operation faster, you just have to keep accessing the data and after some time, it will be included in the cache and the performance will improve.

Also, LVM cache tries to speed up random access patterns. It rarely caches anything for sequential access and the heuristics for this, too, cannot be tuned. The cache is meant to be used in front of storage device that has usable sequential read and write speed but poor performance for random access patterns.

As for writing, if you use writethrough mode, then cache is not used during writing an you obviously get exact same performance as the underlying device.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .