2

Currently I use:

while true; do 
  cat file >/dev/null
  echo 3 | sudo tee /proc/sys/vm/drop_caches
done

to warm up ZFS's l2arc. When I can see accesses are primarily coming from the cache disk, it is done.

But I feel pretty silly doing that.

Is there a way I can tell ZFS: "Hey, could you please put this file into l2arc?"

I do not want to lock the file in l2arc. I just want have it in l2arc the same way it is in l2arc after running the above.

Ole Tange
  • 33,591
  • 31
  • 102
  • 198
  • Why? Just start the process that reads the file earlier if it takes too long. In other words, replace "read data into cache, start process that reads data" with a simple "start process that reads data". – Andrew Henle Nov 24 '20 at 17:41
  • 1
    @AndrewHenle I need a time machine for that :) – Ole Tange Nov 24 '20 at 18:40
  • 1
    @AndrewHenle Assume there is 10TB data, and 1TB l2arc. You know in advance that you have to deliver 10 GB. You know the 1TB data that contains this 10GB, but you do not know *which* 10GB to deliver until the very last moment. – Ole Tange Nov 24 '20 at 18:53
  • Have you tried `vmtouch` utility to put the file in memory? – binarysta May 12 '21 at 18:45
  • 1
    @binarysta He dropped caches in his script because he doesn't have enough RAM to cache all his files. If he had unlimited RAM, he wouldn't be asking this question about warming up L2ARC, now would he? – Navin Oct 04 '21 at 09:40

0 Answers0