Skip to content

Adopt ephpm_kv_wait() + document streaming brotli (ePHPm #184/#185) - #1

Open
luthermonson wants to merge 1 commit into
mainfrom
feat/kv-wait-and-streaming-brotli
Open

Adopt ephpm_kv_wait() + document streaming brotli (ePHPm #184/#185)#1
luthermonson wants to merge 1 commit into
mainfrom
feat/kv-wait-and-streaming-brotli

Conversation

@luthermonson

Copy link
Copy Markdown
Contributor

Summary

  • SSE loop now uses ephpm_kv_wait('board:ver', ...) when the server provides it (function_exists feature detection) — push instead of the 100 ms poll. Unchanged behavior on the published v0.5.0 image.
  • ephpm.toml documents the new compression_streaming = "sse" knob (commented — requires ePHPm > v0.5.0).
  • README gains an "Upstream upgrades" section with measured numbers; limitations 3 and 4 (poll fan-out, no streaming compression) are resolved and removed.

Measured (local release build, WSL2, same box)

  • Idle CPU, 8 SSE clients, 60 s: 0.21 cpu-s (poll) → 0.01 cpu-s (wait).
  • paint→event first-byte latency: p50 100.4 ms → 1.21 ms.
  • 60 s / 120-paint session wire bytes: 1,889,173 → 4,504 (~15.6 KB → ~37 B per event, ~420×), stream decodes per event mid-flight (curl -N --compressed).

Test plan

  • Ran against a fresh ePHPm build with both PRs: wait path active, numbers above.
  • Poll fallback exercised against the same binary using the pre-change worker.php (control) — and the fallback branch is identical code to the old loop.

The two ePHPm PRs the spec doc proposed have landed upstream
(ephpm/ephpm#184, ephpm/ephpm#185). This makes the demo consume them:

- worker.php: the SSE loop feature-detects ephpm_kv_wait() and switches
  from the 100 ms board:ver poll to a blocking wait — measured (same
  binary, 8 idle clients, 60 s): idle CPU 0.21 -> 0.01 cpu-s and
  paint->event latency p50 100.4 ms -> 1.2 ms. Falls back to the poll
  loop unchanged on v0.5.0 images.
- ephpm.toml: commented [server.response] compression_streaming = "sse"
  block explaining the per-connection persistent-window brotli encoder.
- README: new "Upstream upgrades" section with the measured numbers
  (1,889,173 -> 4,504 wire bytes over a 60 s / 120-paint session, ~420x)
  and the two fixed limitations removed from the honest-limitations list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant