Gitlab::Geo.enabled? should use a persistent cache
The method Gitlab::Geo.enabled?
is cached using RequestStore. This means that while the data is re-used in the same request, it's not re-used in different requests. This means that in the worst case for GitLab.com we can be running 80 000 queries per minute, all returning false
.
This method should use a persistent cache of sorts. The easiest that I can think of is to:
- Use Redis for the cache
- Flush the cache whenever a Geo node is created
This can significantly cut down the number of queries we're running.
cc @brodock