What does Lazy Tool Hubs conclude, in numbers, about “Queueing with Cold Starts: the Delay Bill of Lazy Loading and How Long to Stay Warm”?

Answer: Chapter 5 treats cold starts with a queue with set-up times and the ski-rental rule, whose break-even warm period is never worse than 2.000 times the optimum under any distribution of gaps.

Scope of the numbers: Selection accuracy lacks reliable peer-reviewed primary evidence and is demoted to an author's hypothesis. Marked boxes separate published evidence, runnable Python calculations (17 programs), classical sources and the author's hypotheses.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 2.000

gap lawtau=0tau=Btau=600neverworst B
exp mean 30 s4.081.081.021.022.000
exp mean 600 s1.101.903.905.532.000
lognorm med 60 s s=21.831.672.726.892.000
pareto a=1.2 min 10 s4.081.201.312.432.000
Poisson calls: keep warm forever iff rate > 1/B = 0.00833 per s
Show the full program
# Chapter 5. p52: how long to keep an idle worker warm (ski rental).
# Cost unit: one second of a warm idle worker. A cold start costs B =
# 120 such seconds (illustrative). After a call the worker stays warm
# for tau seconds. If the next call comes after a gap X <= tau it is
# warm (cost X); otherwise the cost is tau + B. An oracle that knows X
# pays min(X, B). tau = B is the break-even rule of Karlin et al. 1988:
# never more than twice the oracle, whatever the gaps. Gap laws below
# are illustrative; each row uses 200000 seeded gaps.
import math
import random

rng = random.Random(20261113)
B = 120.0
LAWS = (("exp mean 30 s", lambda: rng.expovariate(1 / 30.0)),
        ("exp mean 600 s", lambda: rng.expovariate(1 / 600.0)),
        ("lognorm med 60 s s=2", lambda: rng.lognormvariate(
            math.log(60.0), 2.0)),
        ("pareto a=1.2 min 10 s", lambda: 10.0 * rng.paretovariate(1.2)))
TAUS = (("tau=0", 0.0), ("tau=B", B), ("tau=600", 600.0),
        ("never stop", float("inf")))


def online(x, tau):
    return x if x <= tau else tau + B


print("gap law                tau=0  tau=B  tau=600  never  worst B")
for name, draw in LAWS:
    xs = [draw() for _ in range(200000)]
    off = math.fsum(min(x, B) for x in xs)
    row = [math.fsum(online(x, t) for x in xs) / off for _, t in TAUS]
    worst = max(online(x, B) / min(x, B) for x in xs if x > 0)
    print("%-21s %6.2f %6.2f %8.2f %6.2f %8.3f"
          % (name, row[0], row[1], row[2], row[3], worst))
# 泊松到达时最优 tau 只有两个端点:调用率高于 1/B 就常驻,否则用完即停
print("Poisson calls: keep warm forever iff rate > 1/B = %.5f per s"
      % (1 / B))

Single source and citation

Fan, Y. (2026). A Lazy-Loading Private Tool Hub: Near-Zero Opening Context for Hundreds of Checkers and On-Demand Routing Trees (Version 1.0.0), Chapter 5: Queueing with Cold Starts: the Delay Bill of Lazy Loading and How Long to Stay Warm. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-257 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026257,
  author    = {Fan, Yafu},
  title     = {A Lazy-Loading Private Tool Hub: Near-Zero Opening Context for Hundreds of Checkers and On-Demand Routing Trees},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book