Open abdulmi opened 1 year ago
Hi, sorry for the late reply, for the size, highly depends on the content that will be stored. So, unfortunately, there are no suggestions here.
I had a similar question and I think the root is that it's unclear how to connect the size + sample parameters into an estimate of total memory usage & vice-versa (& just in general what those parameters control). More broadly, it's not even really clear what the size & sample values control. AFAICT:
window_cache_size
)probationary_cache_size + protected_cache_size
)2 * (window_cache_size + probationary_cache_size + protected_cache_size)
and 4 * (window_cache_size + probationary_cache_size + protected_cache_size)
if I'm not mistaken because there's 4 filters of length size rounded down to the nearest power of 2 approximately).Is that correct? Is there a more elegant way to convert human-friendly requirements (e.g. "I want to use at most 100 MiB of space with a false-positive rate of 1%" and maybe something like "here's the percentage breakdown among the different components within the LFU") into the actual parameters needed?
@al8n can you help provide some color commentary on what the different parameters control & how they relate to memory usage / cache hit ratio? I'm not sure I fully understand how to convert target memory usage requirements into the parameters for the cache.
Is there a strategy for choosing the sample size for the cache ? Based on the example provided its the sum of all windows, but just wanted to check if there's a suggested way to choose the sample size, and what are the implications for choosing a bigger or smaller sample size ?
The parameter I am talking about is the one passed to the WTinyLFUCache::with_sizes function