知识卡片

普通读书笔记卡 · 3366

重试须限制放大效应

理解等级:高级

失败重试若无限叠加,会在依赖恢复时形成请求群涌,反而扩大故障。为重试设置次数和时间预算,并使用指数退避与随机抖动;只有操作具备可安全重试的语义时才采用。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Principles of Software Architecture Modernization》第2章《Anti-Patterns: Lack of Isolation》(源文件:`_epub-src/OPS/ch02.xhtml`,归一化正文 [71411:75552)) - 结论依据:原文指出重试可能造成级联故障与惊群,安全算法使用随机抖动和指数退避;次数预算与幂等边界是据此补出的工程限制。 - 原始内容:Retries need to be used with caution; otherwise, they can create additional availability problems and create cascading failures. If a group of services is down, you can have lots of retries that can make the service go down and then get up again; this is called the thundering herd problem. Safe retry algorithms typically introduce jitter, a random time between multiple attempts; and exponential backoff, where we exponentially increase the wait time between retry attempts.