关于「自愈:退避、熔断与可用性账本」,《手机指挥容器集群》给出的定量结论是什么?
结论:第五章用退避、抖动、熔断与马尔可夫模型算出,人在手机端平均四十五分钟修好时,自动修复份额至少要 0.948 才进得了预算。
数据口径:书中参数为示意;全部计算由书中程序生成;本书是非个人化经营建议,不承诺任何可用性数字,只写书、不连接任何机器。 书中以标注框区分已发表的证据、可运行的 Python 计算(22 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.948
| budget for 0.999 over 30 days: 43.2 min | ||||||
| case | avail | down min | P50 | P90 | P99 | in budget |
| none, at desk | 0.99654 | 150.0 | 10.4 | 34.4 | 71.1 | no |
| none, phone | 0.98969 | 450.0 | 31.6 | 103.7 | 212.2 | no |
| auto 0.8, phone | 0.99746 | 110.0 | 1.9 | 33.6 | 142.6 | no |
| auto 0.9, phone | 0.99850 | 65.0 | 1.6 | 8.8 | 112.8 | no |
| auto 0.97, phone | 0.99923 | 33.5 | 1.5 | 5.1 | 48.9 | yes |
| auto 0.9, asleep | 0.99677 | 140.0 | 1.6 | 10.9 | 274.2 | no |
| 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}
}