vmtouch
vmtouch copied to clipboard
Is it possible to evict partial of cached file ?
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 ?
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?