Hi, I am studying redis when it is used as a cache. Base on this article: https://redis.io/topics/lru-cache, the hit ratio should increase when the sample size is increased. However, I change the sample size from 2 to 10, but my hit ratio does not change. My workload follows power-law distribution. What could be the reason?

Comment From: madolson

I don't fully follow your setup. Are you are setting 2 or 1.0 keys then sending some traffic (unclear what is) and observe the hit rate in info.

Comment From: sundb

Are you talking about the sample config for eviction?

Comment From: thebirdfromsea

Hi,

I use Redis as cache in my case. It needs to evict some keys after it is full. I choose the eviction policy is allkeys-lru in the config file. The sample size I use is 2 and 10 each time. My workloads follow power law distribution pattern. I expect the hit ratio should increase when I switch 2 to 10, but it does not. I am very confused here.

Comment From: thebirdfromsea

Are you talking about the sample config for eviction?

Yes.

Comment From: thebirdfromsea

I don't fully follow your setup. Are you are setting 2 or 1.0 keys then sending some traffic (unclear what is) and observe the hit rate in info.

I generate some traffics and those traffic follows power law. I change the sample size from 2 to 10. Then, I observe the hit ratio but it does not change.

Comment From: sundb

Hi, @thebirdfromsea, What is the version of redis you use? What is the total number of keys you have?