Page 1 of 1

Improved Cache Algorithm

Posted: Sun Sep 19, 2021 3:11 pm
by steveb
From very limited testing Primocache seems to act similar to FIFO (i could be very wrong), it would be handy to be able to set X percentage of the cache for a improved read cache algorithm. Ideally one that keep a history of the blocks accessed over time, like nearly any of the so called "Intelligent Cache" solutions.

Also, maybe worth looking at other solutions like PLC-cache.

Re: Improved Cache Algorithm

Posted: Mon Sep 20, 2021 10:47 am
by InquiringMind
PrimoCache currently uses an LRU (Least Recently Used) algorithm to determine which blocks to discard when full.

Older versions (2.x if I recall correctly) gave the choice between LRU and LFU (Least Frequently Used) algorithms. It would be interesting to hear from support why LFU was removed, as there are certain cases where it could be useful.

Re: Improved Cache Algorithm

Posted: Mon Sep 20, 2021 3:09 pm
by steveb
InquiringMind wrote: Mon Sep 20, 2021 10:47 am PrimoCache currently uses an LRU (Least Recently Used) algorithm to determine which blocks to discard when full.

Older versions (2.x if I recall correctly) gave the choice between LRU and LFU (Least Frequently Used) algorithms. It would be interesting to hear from support why LFU was removed, as there are certain cases where it could be useful.
Thanks for the clarification regarding LRU. With the configuration option of being able to split your read vs write cache, LFU could be handy in some cases for the read cache.

Re: Improved Cache Algorithm

Posted: Tue Sep 21, 2021 2:12 pm
by Support
InquiringMind wrote: Mon Sep 20, 2021 10:47 am PrimoCache currently uses an LRU (Least Recently Used) algorithm to determine which blocks to discard when full.

Older versions (2.x if I recall correctly) gave the choice between LRU and LFU (Least Frequently Used) algorithms. It would be interesting to hear from support why LFU was removed, as there are certain cases where it could be useful.
Not exactly. LFU, as well as other algorithms, is also be used internally. We try to implement an intelligent caching algorithm based on detected data patterns. So the explicit option for choosing algorithm has been removed. Besides, this keeps the UI simple for users.

Re: Improved Cache Algorithm

Posted: Tue Sep 21, 2021 3:28 pm
by steveb
Support wrote: Tue Sep 21, 2021 2:12 pm
InquiringMind wrote: Mon Sep 20, 2021 10:47 am PrimoCache currently uses an LRU (Least Recently Used) algorithm to determine which blocks to discard when full.

Older versions (2.x if I recall correctly) gave the choice between LRU and LFU (Least Frequently Used) algorithms. It would be interesting to hear from support why LFU was removed, as there are certain cases where it could be useful.
Not exactly. LFU, as well as other algorithms, is also be used internally. We try to implement an intelligent caching algorithm based on detected data patterns. So the explicit option for choosing algorithm has been removed. Besides, this keeps the UI simple for users.
Does this mean your current intelligent caching algorithm keep a history of blocks accessed over a reasonable period of time?

Re: Improved Cache Algorithm

Posted: Wed Sep 22, 2021 5:59 am
by Support
steveb wrote: Tue Sep 21, 2021 3:28 pm Does this mean your current intelligent caching algorithm keep a history of blocks accessed over a reasonable period of time?
I'm sorry but I don't know such details.