Skip to content

Update Rails application to use redis-ratelimiting instance

This will involve a new class Gitlab::Redis::RackAttack inheriting from https://gitlab.com/gitlab-org/gitlab/blob/f1b74329658238a0014af6dd714e1b588ad7fa15/lib/gitlab/redis/wrapper.rb. It is probably similar to the TraceChunks class, but needs to fall back to Cache, not SharedState.

Per the notes in &526, due to the nature of rate-limiting and our configured window (1 minute), cutover has some flexibility in timing and we don't need multi-phase multi-write phased. A feature flag may be desirable for the duration to enable a quick switch/revert in case there is something unexpectedly wrong with the new dedicated Redis, but the data lifetime is 60s and we can live with a slightly looser effective rate-limit for a few (10s of) minutes during switchover.

Also take into consideration any documentation from #1291 (closed)

We're using:

  1. An env var for Rack::Attack (this picks its Redis instance on application boot).
  2. A feature flag for Gitlab::ApplicationRateLimiter.
Edited by Sean McGivern