mikerhodes commented on PR #5625:
URL: https://github.com/apache/couchdb/pull/5625#issuecomment-3211112536

   I don't think the eviction algorithm choice is un-smart. It's quite a nice 
least-used algorithm that looks to be quite scan-resistant due to the way it 
exponentially decays (this is useful against applications which "scan" by 
periodically open a lot of databases, rather than scan a single file on disk).
   
   The scan resistance property is why something like ets-lru doesn't make as 
much sense for this use-case. If the cache gets full, hopefully it's full of 
stuff we use a lot, rather than just what we opened recently. For those 
periodic cases, we don't churn the cache for them.
   
   [TinyLFU](https://dl.acm.org/doi/10.1145/3149371) is quite interesting in 
that it uses a sketch to decide whether to add something to the cache at all, 
which is also nice against the scan-databases use-case, but also seems quite a 
bit more complicated. I note that it also degrades by dividing by two.
   
   TinyLFU or something like it could be _really_ useful for things like the 
main LRU where we keep open files --- avoiding evicting things during periodic 
database scans would be good.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to