关于「原典考辨:「穷则变,变则通,通则久」与忒修斯之船」,《单机零停机热迁与十秒止血》给出的定量结论是什么?
结论:第七章考辨「穷则变,变则通,通则久」与忒修斯之船,扩展收缩式把最优变更频率提到每年 52.7 次。
数据口径:书中只讲通用的数学模型,例子用虚构的 app-blue、app-green 与 db;参数为示意,全部计算由书中程序生成,程序不连接任何服务器;本书是非个人化的经营与工程参考,生产变更须按运维协议人工放行。 书中以标注框区分已发表的证据、可运行的 Python 计算(22 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 52.7
| c = expected outage per change in seconds; L in minutes a year | |||||||
| policy | c | f=4 | f=12 | f=52 | f=260 | f* | L* |
| big-bang | 280.600 | 227.0 | 125.6 | 259.2 | 1219.1 | 13.3 | 124.9 |
| expand-contract | 17.985 | 209.5 | 73.0 | 31.6 | 81.1 | 52.7 | 31.6 |
| ten-second path | 0.650 | 208.4 | 69.6 | 16.6 | 6.0 | 277.4 | 6.0 |
| never changing: L grows without bound as f -> 0 |
查看完整验算程序
# Chapter 7. p72: "when a course runs out, change": how often to change.
# Model: a system changed f times a year pays c seconds of expected
# outage per change (bad share 0.05 times the outage per bad release
# from p32: big-bang 5612.0 s, expand-contract 359.7 s; and 13 s for a
# release that always meets the fast path). Not changing also costs:
# fixes pile up and the exposure grows with the age of the running
# version, giving a yearly loss K / f with K = 50000 s (illustrative).
# Total yearly loss L(f) = c f + K / f is least at f* = sqrt(K / c),
# where L* = 2 sqrt(c K). Cheaper changes make frequent change right.
import math
K = 50000.0
BAD = 0.05
POLICIES = (("big-bang", BAD * 5612.0), ("expand-contract", BAD * 359.7),
("ten-second path", BAD * 13.0))
FREQS = (4, 12, 52, 260)
print("c = expected outage per change in seconds; L in minutes a year")
print("%-15s %7s " % ("policy", "c") +
"".join("%8s" % ("f=%d" % f) for f in FREQS) + "%7s %7s" % (
"f*", "L*"))
for name, c in POLICIES:
cells = "".join("%8.1f" % ((c * f + K / f) / 60.0) for f in FREQS)
fstar = math.sqrt(K / c)
print("%-15s %7.3f %s%7.1f %7.1f" % (
name, c, cells, fstar, 2.0 * math.sqrt(c * K) / 60.0))
print("never changing: L grows without bound as f -> 0")唯一数据源与引用
范雅福(Fan, Y.). (2026). 《单机多容器零停机热迁与回滚、共享隧道架构生产库无损演进与十秒止血契约母典》第 7 章「原典考辨:「穷则变,变则通,通则久」与忒修斯之船」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-269 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026269,
author = {Fan, Yafu},
title = {Zero-Downtime Hot Migration and Rollback on Multi-Container Single Hosts: Lossless Schema Evolution behind a Shared Tunnel and a Ten-Second Stop-the-Bleeding Contract},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}