Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMake all the caching components use snappy #2380
Comments
|
@gouthamve Can I work on this? |
|
@RajatVaryani sure go ahead! |
Signed-off-by: Rajat Varyani <rajat.varyani@outlook.com>
|
Hi, I want to work on supporting snappy cache in the query-frontend, since Thanos can also benefit from it. Now my idea is to add a func NewResultsCacheMiddleware(
logger log.Logger,
cfg ResultsCacheConfig,
splitter CacheSplitter,
limits Limits,
merger Merger,
extractor Extractor,
cacheGenNumberLoader CacheGenNumberLoader,
shouldCache ShouldCacheFn,
reg prometheus.Registerer,
) (Middleware, cache.Cache, error) {
c, err := cache.New(cfg.CacheConfig, reg, logger)
if err != nil {
return nil, nil, err
}
if cfg.EnableSnappy {
c = cache.NewSnappy(c, logger)
}
...
}If you think this way looks ok, I can do some performance testing and open a pr. |
|
Why not directly passing |
|
Hi @pracucci, did you mean to always use |
|
We should allow to configure which compression should be used, but I'm wondering if we should do it in the parent caller to |
|
I still think that adding a EnableSnappy config to ResultsCacheConfig is better since we don't need to update the function signatures. I will create a pr and we can talk there. |


We have an easy way to add snappy compression to caches, and we do it for the index-read-cache. But we should add it to other caches, specially the frontend-results cache.
We had it in the frontend-cache, but we lost it in this refactoring by mistake: #1437