关于「自愈:退避、熔断与可用性账本」,《手机指挥容器集群》给出的定量结论是什么?

结论:第五章用退避、抖动、熔断与马尔可夫模型算出,人在手机端平均四十五分钟修好时,自动修复份额至少要 0.948 才进得了预算。

数据口径:书中参数为示意;全部计算由书中程序生成;本书是非个人化经营建议,不承诺任何可用性数字,只写书、不连接任何机器。 书中以标注框区分已发表的证据、可运行的 Python 计算(22 段程序)、原典与作者的假说。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.948

budget for 0.999 over 30 days: 43.2 min
caseavaildown minP50P90P99in budget
none, at desk0.99654150.010.434.471.1no
none, phone0.98969450.031.6103.7212.2no
auto 0.8, phone0.99746110.01.933.6142.6no
auto 0.9, phone0.9985065.01.68.8112.8no
auto 0.97, phone0.9992333.51.55.148.9yes
auto 0.9, asleep0.99677140.01.610.9274.2no
auto-repair share needed, R = 45 min: 0.948
auto-repair share needed, R = 120 min: 0.981
查看完整验算程序
# Chapter 5. p53: availability with self-repair and a human on a phone
# Three-state Markov model: Up -> Repairing (automatic restart, mean 2
# min) -> Up with probability s, else -> Human (mean repair R min) ->
# Up. Ten failures per 30 days (illustrative). Times are exponential.
# Steady-state availability A = 1 / (1 + lam * (T_repair + (1 - s) R)).
# Recovery-time quantiles come from 20,000 simulated failures per row.
import random

FAILS, MONTH_MIN = 10, 30 * 24 * 60
LAM = FAILS / MONTH_MIN
T_REP = 2.0
BUDGET = MONTH_MIN * (1.0 - 0.999)
rng = random.Random(41653)
ROWS = (("none, at desk", 0.0, 15.0), ("none, phone", 0.0, 45.0),
        ("auto 0.8, phone", 0.8, 45.0), ("auto 0.9, phone", 0.9, 45.0),
        ("auto 0.97, phone", 0.97, 45.0), ("auto 0.9, asleep", 0.9, 120.0))

print("budget for 0.999 over 30 days: {:.1f} min".format(BUDGET))
print("case              avail     down min  P50   P90    P99  in budget")
for name, s, r in ROWS:
    repair = T_REP if s > 0 else 0.0
    per_fail = repair + (1.0 - s) * r
    avail = 1.0 / (1.0 + LAM * per_fail)
    down = FAILS * per_fail
    xs = []
    for _ in range(20000):
        x = rng.expovariate(1.0 / T_REP) if s > 0 else 0.0
        if rng.random() >= s:
            x = x + rng.expovariate(1.0 / r)
        xs.append(x)
    xs.sort()
    q = [xs[int(p * len(xs))] for p in (0.5, 0.9, 0.99)]
    print("{:<16}  {:.5f}  {:>8.1f}  {:>4.1f}  {:>5.1f}  {:>5.1f}  {}".format(
        name, avail, down, q[0], q[1], q[2], "yes" if down <= BUDGET
        else "no"))
for r in (45.0, 120.0):
    need = 1.0 - (BUDGET / FAILS - T_REP) / r
    print("auto-repair share needed, R = {:.0f} min: {:.3f}".format(r, need))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《移动终端单手遥控多容器集群、异常中断推送滤波与离席零停摆指挥母典》第 5 章「自愈:退避、熔断与可用性账本」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-416 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026416,
  author    = {Fan, Yafu},
  title     = {Pocket Command of Multi-Container Fleets: Mobile Remote Control, Exception-Only Push Filtering and Away-From-Keyboard Continuity},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论