vmtouch icon indicating copy to clipboard operation
vmtouch copied to clipboard

Is it possible to evict partial of cached file ?

Open aero opened this issue 5 years ago • 1 comments

Hello,

cachectl( https://github.com/cubicdaiya/cachectl ) supports -r option.

If you want to leave a cache appended recently, assigning a rate for purging page cache with -r is recommended.

cachectl -op purge -f /var/log/access_log -r 0.9

Can I get the same fuctionality with vmtouch ?

aero avatar Jun 04 '20 00:06 aero

Not exactly the same, but you can choose a range of the file to evict with -p. For example, suppose you had a 100M file, you could run:

vmtouch -e -p 0-90M /var/log/access_log

To evict the first 90M of the file and leave the remaining unevicted.

How does cachectl decide which part of the file to evict?

hoytech avatar Jun 04 '20 04:06 hoytech