← 返回起始笔记位置

知识卡片

普通读书笔记卡 · 2313.e.5.f.10.b.3.e.1.a.1.b.5.a

过期抖动分散缓存雪崩

理解等级:中级

大量键同刻过期或缓存整体故障会同时把流量推向数据库。TTL加入随机抖动、滚动刷新并保护数据库准入,可降低相关失效;抖动只分散过期,不能解决整层缓存不可用的全部压力。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Distributed Caching · 查看原书依据

      Cache avalanche presents a similar challenge when many cache entries expire simultaneously. This commonly occurs when the following happens: A large number of cache entries are set with the same TTL A cache server fails Cache clearing operations affect too many entries Following are the ways to prevent avalanche scenarios: Add random jitter to TTL values Use rolling cache updates Implement circuit breakers for database protection Thundering herd or stadium gate problem Consider a stadium with thousands of fans waiting for the gates to open.

    参考来源

    - 位置:《Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…》第11章《Distributed Caching》(来源项目book-sources;源文件:extracted/Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…/_epub-src/OPS/ch11.xhtml) - 结论依据:原文的机制或对比支持以下核心判断:大量键同刻过期或缓存整体故障会同时把流量推向数据库。 本卡将相邻说明中的适用限制保留为解释。 - 原始内容:Cache avalanche presents a similar challenge when many cache entries expire simultaneously. This commonly occurs when the following happens: A large number of cache entries are set with the same TTL A cache server fails Cache clearing operations affect too many entries Following are the ways to prevent avalanche scenarios: Add random jitter to TTL values Use rolling cache updates Implement circuit breakers for database protection Thundering herd or stadium gate problem Consider a stadium with thousands of fans waiting for the gates to open.