This message was deleted.
# troubleshooting
s
This message was deleted.
t
I have seen its usage in production . Any reason you asked ?
d
@Mark Herrera yes. I am wondering if consolidating all caches to a dedicated store will lead to more efficient cache hit %. I am thinking of using https://github.com/Snapchat/KeyDB for the “Redis” backend.
m
I haven't seen an efficiency consideration, but maybe @Tijo Thomas has? I've seen Redis brought up when people want to use different, off-machine caches. For example, use one cache for one type of query, and then use another cache for a different type of query. So, your question of consolidating all caches to a dedicated store might be a novel one. Hopefully others will chime in as well.
d
Quick question, the broker does not talk to each other when it comes to cache data, is that correct? E.g. this scenario: • query A lands on broker A, its result is cached on broker A. • exact same query A lands on broker B, what happens here? I am guessing that broker B will simply cache the query result again, yes?
g
yes, that's exactly right, unless they have a shared cache (like memcached or redis)
in shared-cache case, Broker B will check the cache, and be able to use it
However, watch out for Broker-based caching in general… for the per-segment cache, it can be detrimental at scale. See here: https://druid.apache.org/docs/latest/querying/caching.html#where-to-enable-caching
Avoid using per-segment cache at the Broker for large production clusters. When the Broker cache is enabled (druid.broker.cache.populateCache is true) and populateCache is not false in the query context, individual Historicals will not merge individual segment-level results, and instead pass these back to the lead Broker. The Broker must then carry out a large merge from all segments on its own.
👍 1
For this reason, we generally recommend having caching enabled on Historicals but not Brokers
On using shared cache (memcached/redis): it does increase hit rate, but also increases latency, due to the hop needed to the remote cache for every query. It's worth evaluating in your prod environment whether this tradeoff is worth it. Depends heavily on your users' query patterns.
d
ah, good point about another extra network hops to get the cache data.
t
@Didip Kerabat , We are working towards removing redis cache in one of the customer who heavily uses redis cache . One of the reason is the maintainability of the redis infra. We are doing some tests before changing it to Caffeine cache and i will let u know the results.
🙏 1