Cache Stampede Protectionとは?
cache stampede protectionは、人気のあるcacheエントリが消えたときに、大量のクライアントが同じ高コストな値を同時に再計算するのを止める一連の手法です。一般的なアプローチでは、1つのクライアントが再計算する間、他は待機するか、やや古い値を返すようにします。目的は、素朴なcacheが被るthundering-herd型の負荷スパイクを避けることです。
なぜ重要か
よく使われるキーが期限切れになると、すべての同時リクエストがmissして一斉に再生成を試み、まさに最も忙しいときにバックエンドシステムを叩きます。single-flight lockingや早期再計算といった保護機構は、その再生成を1つのworkerに抑えます。CIでは、共有cache backendでのstampedeが、多数のrunnerを同じ瞬間に停滞させることがあります。
関連ガイド
What Is Cache Warming?Cache warming pre-populates a cache before it is needed so the first real requests hit a ready cache instead…
What Is a Negative Cache?A negative cache stores the fact that a lookup failed or a value is absent, so repeated misses can be answere…
What Is a Remote Cache Backend?A remote cache backend is shared storage where build and test caches live so many machines and CI runs can re…