Skip to content

Commit f2fca4c

Browse files
committed
docs(tcp): state the slow-batch mechanism the hosted probe showed
A per-round probe on hosted macOS runners found single slow batches coming from bursts that slow many rounds and from whole-program pauses of 20 to 55 ms, with no round near the reactor's 100 ms poll timeout. The test header and the status paragraph now say so, and the status paragraph records the unexplained 126 to 137 ms rounds seen under full CPU load.
1 parent 783200b commit f2fca4c

2 files changed

Lines changed: 21 additions & 11 deletions

File tree

‎docs/PROJECT_STATUS.md‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,20 @@ unproven. Background compiler load is a hypothesis, not an established excuse.
175175
`tcp_reactor_perf` used to fail when a single batch took more than five
176176
times the median. On a loaded macOS host, an equivalent loop on OTP 29
177177
failed that rule too, and unchanged Nera builds failed it in roughly one
178-
run in 250. One host pause can slow any one batch. The test now times
179-
batches in microseconds and fails only when a stall or slowdown shows in
180-
at least two batches. Injected 100 ms stalls on every connection's first
181-
round, recurring 100 ms stalls, and a 1 ms slowdown per round from a
182-
connection's 300th or 600th round still fail it. One isolated pause does
183-
not, and neither does a real stall that happens only once per run.
178+
run in 250. A per-round probe on hosted macOS runners found the same rule
179+
failing about one run in 110 with no round near 100 ms. There, bursts
180+
slowed many rounds a little, and the host paused the whole program for 20
181+
to 55 ms; one batch took 103 ms while its slowest round took 23 ms. Under
182+
full CPU load the probe also saw isolated rounds of 126 to 137 ms that a
183+
timer-driven process running alongside did not see. They sit just above
184+
the 125 ms period at which the macOS scheduler recomputes thread
185+
priorities, not near the reactor's 100 ms poll timeout; their cause is not
186+
proven. The test now times batches in microseconds and fails only when a
187+
stall or slowdown shows in at least two batches. Injected 100 ms stalls on
188+
every connection's first round, recurring 100 ms stalls, and a 1 ms
189+
slowdown per round from a connection's 300th or 600th round still fail it.
190+
One isolated pause does not, and neither does a real stall that happens
191+
only once per run.
184192

185193
The test runner accepts exit 0 without proof of completion unless `%% EXPECT:`
186194
is supplied. P0-1 demonstrates why this is insufficient. Several reactor tests

‎tests/tcp_reactor_perf.erl‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
%% stall patterns: re-arms that keep waiting for a fallback wakeup, and
77
%% throughput that degrades while a connection keeps running.
88
%%
9-
%% One slow batch is not a pattern. The host can pause this process once,
10-
%% for tens of milliseconds, whatever the runtime does; that slows a single
11-
%% batch. On a loaded host an equivalent loop on OTP 29 also fails a
12-
%% single-batch rule. Each check therefore fails only when the slowdown
13-
%% shows in at least two batches. Batches are timed in microseconds.
9+
%% One slow batch is not a pattern. On a busy host, a burst of activity
10+
%% slows many rounds a little, and the host can pause the whole program for
11+
%% tens of milliseconds. Either can put one batch nearly 100 ms over the
12+
%% others while no single round takes that long. On a loaded host an
13+
%% equivalent loop on OTP 29 also fails a single-batch rule. Each check
14+
%% therefore fails only when the slowdown shows in at least two batches.
15+
%% Batches are timed in microseconds.
1416

1517
test() ->
1618
ok = test_active_once_batch_consistency(),

0 commit comments

Comments
 (0)