Skip to content

Cache Geo checks for a certain time period instead of per request

Stan Hu requested to merge sh-cache-geo-check-in-memory into master

Before these checks would always check Redis once per request, and the Redis key had a timeout of 15 seconds. However, this polling can add significant load to the Redis server. Instead, revise the caching strategy instead to the following:

  • L1 cache (thead-local, memory store): 1 minute
  • L2 cache (Redis): 2 minutes

The downside is cache invalidation: it will take up to 2 minutes for any changes in the Geo nodes to propagate to a secondary.

Relates to gitlab-com/gl-infra/production#928 (closed)

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/12591

Edited by Stan Hu

Merge request reports