Skip to content

Enable QueryCache for LoadBalancing

While working on epic: &3873 (closed), I encountered that all GET requests that hit LoadBalancer, are not cached. https://gitlab.slack.com/archives/CMMF8TKR9/p1604072634340600

  • With Load Balancer: Screenshot_at_Oct_26_16-37-18
  • Without Load Balancer: Screenshot_at_Oct_26_15-55-13

We use LB for GET requests unless write happens, otherwise, we use primary. So, we might dynamically switch from LB to direct access, and it looks that when we hit LB, those queries are not CACHED (Caching is disabled)

We can see that for the same end-point, we have: 2 times ~1,256 (1,184 CACHED) executed queries 8 times ~1,256 (0 CACHED) executed queries https://log.gprd.gitlab.net/goto/3202017cc2078fcfab6c0e349d280b7b Screenshot_at_Nov_03_12-37-57

Based on this, it seems that we never enable_query_cache for loadbalancing connections

Edited by Nikola Milojevic