关于「独立性不成立时:相关慢、坏机器与同步后台任务」,《扇出尾延迟与对冲请求》给出的定量结论是什么?
结论:第三章并陈相关性的两个方向:坏时段让慢页面降到 0.4033,固定坏机器配合不放回访问让它升到 0.6740,同步后台任务把它压到 0.0104。
数据口径:书中服务时间、慢请求比例与成本均为示意参数;全部计算由书中程序生成;本书属于非个人化经营建议。 书中以标注框区分已发表的证据、可运行的 Python 计算(22 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.4033
| marginal p = 0.01 per call, N = 100 calls per page | |||||
| w | pb | pg | rho | P(page slow) | slow/slow-page |
| 0.000 | 0.01 | 0.01000 | 0.0000 | 0.6340 | 1.58 |
| 0.005 | 0.50 | 0.00754 | 0.1219 | 0.5331 | 1.88 |
| 0.010 | 0.50 | 0.00505 | 0.2450 | 0.4033 | 2.48 |
| 0.010 | 0.90 | 0.00101 | 0.8082 | 0.1052 | 9.51 |
| 0.020 | 0.40 | 0.00204 | 0.3135 | 0.2011 | 4.97 |
| 0.050 | 0.10 | 0.00526 | 0.0431 | 0.4395 | 2.28 |
| 0.100 | 0.05 | 0.00556 | 0.0180 | 0.4838 | 2.07 |
| independence gives 0.6340; full correlation gives 0.0100 |
查看完整验算程序
# Chapter 3. p31: correlated slowness that keeps the per-call rate fixed.
# Mixture model: a page falls in a "bad epoch" with probability w; then
# each of its N = 100 calls is slow with probability pb, otherwise with
# probability pg, where w pb + (1 - w) pg = 0.01 keeps every call's
# marginal slow rate at 0.01. rho is the intra-page correlation of the
# slow indicators. All parameter pairs are illustrative.
import math
P, N = 0.01, 100
def page_slow(p, n):
return -math.expm1(n * math.log1p(-p))
def mixture(w, pb):
pg = (P - w * pb) / (1.0 - w)
slow = w * page_slow(pb, N) + (1.0 - w) * page_slow(pg, N)
rho = w * (1.0 - w) * (pb - pg) ** 2 / (P * (1.0 - P))
return pg, slow, rho
if __name__ == "__main__":
print("marginal p = 0.01 per call, N = 100 calls per page")
print(" w pb pg rho P(page slow) slow/slow-page")
rows = ((0.0, 0.01), (0.005, 0.5), (0.01, 0.5), (0.01, 0.9),
(0.02, 0.4), (0.05, 0.1), (0.1, 0.05))
for w, pb in rows:
pg, slow, rho = mixture(w, pb)
per = N * P / slow
fmt = " {:5.3f} {:5.2f} {:7.5f} {:6.4f} {:6.4f}"
print(fmt.format(w, pb, pg, rho, slow) + " {:6.2f}".format(per))
print("independence gives {:.4f}; full correlation gives {:.4f}".format(
page_slow(P, N), P))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《扇出尾延迟乘法律与对冲请求、单页多调用时百分位延迟的放大母典》第 3 章「独立性不成立时:相关慢、坏机器与同步后台任务」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-326 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026326,
author = {Fan, Yafu},
title = {The Multiplicative Law of Fan-Out Tail Latency and Hedged Requests: How Percentile Latency Amplifies When One Page Makes Many Calls},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}