Commit e73221d
authored
Add renderer transport probe (#3784)
## Summary
- add benchmark-only probe comparing Fastify h2c TCP, native
`node:http2` h2c TCP, and native `node:http2` over Unix socket
- document the probe under `react_on_rails_pro/scripts/load`
- keep production renderer defaults/config untouched
Refs #3582
Refs #3583
## Codex Decision Log
- Kept this as Phase 0 evidence only; no Fastify replacement or UDS
production transport is selected here.
- Added cleanup/body-limit safeguards so custom payload and skip-UDS
runs do not produce misleading results or remove caller-owned files.
- Local benchmark evidence is macOS/same-host microprobe only;
Linux/topology validation against the real renderer harness remains
required before product decisions.
## Local benchmark note
Full local probe at `/tmp/ror-transport-probe-full` (3000 requests, 300
warmup, zero failures):
- small_unary p95: Fastify TCP 0.806ms, native TCP 1.090ms, native UDS
0.392ms
- stream_16kb p95: Fastify TCP 0.762ms, native TCP 0.729ms, native UDS
0.444ms
## Validation
- `bundle exec rspec spec/load/transport_probe_spec.rb`
- `bundle exec ruby scripts/load/transport_probe.rb --requests 1
--warmup 0 --body-bytes 1048577 --stream-bytes 1024 --scenarios
fastify_tcp --output-dir /tmp/ror-transport-probe-large-body-current`
- `bundle exec ruby -c scripts/load/lib/transport_probe.rb`
- `node --check scripts/load/transport_probe_server.mjs`
- `bundle exec rubocop --ignore-parent-exclusion
scripts/load/lib/transport_probe.rb scripts/load/transport_probe.rb
spec/load/transport_probe_spec.rb`
- `pnpm exec prettier --check react_on_rails_pro/scripts/load/README.md
react_on_rails_pro/scripts/load/transport_probe_server.mjs`
- `pnpm exec eslint
react_on_rails_pro/scripts/load/transport_probe_server.mjs`
- worker also ran `bundle exec rspec spec/load/`
- `codex review --base origin/main`
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Benchmark-only tooling under `scripts/load` with no production
transport or renderer behavior changes; risk is limited to monorepo
workspace/lockfile updates and local probe execution.
>
> **Overview**
> Adds a **benchmark-only** renderer transport probe under
`react_on_rails_pro/scripts/load` to gather Phase 0 evidence for issues
#3582/#3583. It does **not** change production renderer defaults, Rails
HTTP clients, or runtime transport configuration.
>
> A Ruby CLI (`transport_probe.rb` + `lib/transport_probe.rb`) spawns a
small Node server (`transport_probe_server.mjs`), drives HTTP/2 probe
traffic via `Async::HTTP`, and compares **Fastify h2c TCP**, **native
`node:http2` h2c TCP**, and **native HTTP/2 over Unix domain sockets**
on `small_unary` and `stream_response` workloads. Results include
latency percentiles, RPS, failure counts, baseline selection
(`fastify_tcp` preferred, else `native_tcp`), and per-scenario deltas;
output goes to `transport_probe_summary.json` under
`tmp/load-tests/transport-probe/`.
>
> Monorepo wiring adds `react_on_rails_pro` and
`react_on_rails_pro/scripts/load` to pnpm workspaces with a private
`fastify` devDependency. The load README documents usage, `--skip-uds`,
body-limit semantics, and benchmark caveats. A large RSpec suite covers
config parsing, summary math, Node readiness validation, and Node server
edge cases (body limits, socket path safety, aborted streams).
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5e927ff. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Added HTTP/2 transport probe tool for benchmarking request performance
across Fastify, native HTTP/2, and Unix domain socket transports with
configurable request counts and payload sizes.
* **Documentation**
* Added transport probe documentation with setup instructions,
command-line options, and output file location details.
* **Tests**
* Added comprehensive test suite for transport probe functionality and
edge cases.
* **Chores**
* Updated monorepo workspace configuration to include react_on_rails_pro
package.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Agent Merge Confidence
Mode: accelerated-rc
Score: 9/10
Auto-merge recommendation: yes
Affected areas: Pro benchmark tooling, Node renderer transport research,
monorepo workspace metadata
CI detector: `script/ci-changes-detector origin/main` ->
JavaScript/TypeScript plus uncategorized changes; full suite and
benchmarks recommended
Validation run:
- `cd react_on_rails_pro && bundle exec rspec
spec/load/transport_probe_spec.rb` -> 31 examples, 0 failures
- `cd react_on_rails_pro && bundle exec rubocop
scripts/load/transport_probe.rb scripts/load/lib/transport_probe.rb
spec/load/transport_probe_spec.rb` -> no offenses
- `pnpm exec eslint
react_on_rails_pro/scripts/load/transport_probe_server.mjs` -> pass
- `pnpm exec prettier --check
react_on_rails_pro/scripts/load/transport_probe_server.mjs` -> pass
- `script/check-pro-license-headers --self-test &&
script/check-pro-license-headers --check` on a temporary merge with
`origin/main` -> pass
- `script/ci-changes-detector origin/main` -> full suite + benchmarks
recommended
Review/check gate:
- Claude review: complete for
`5e927ff82805e8cfb256c28261b7c07629282f6a`, no unresolved review threads
- Cursor Bugbot: complete for `5e927ff82805e8cfb256c28261b7c07629282f6a`
- GitHub checks: complete for
`5e927ff82805e8cfb256c28261b7c07629282f6a`; skipped benchmark
confirmation/report rows, docs-format-check, and legacy Claude Code job
are expected non-running paths
Known residual risk: low; this is benchmark-only tooling and does not
change production renderer transport defaults
Finalized by: Claude Code Review check `claude-review` SUCCESS for
`5e927ff82805e8cfb256c28261b7c07629282f6a` (GitHub Actions job
80367689384)1 parent 9bd5482 commit e73221d
9 files changed
Lines changed: 1562 additions & 0 deletions
File tree
- react_on_rails_pro
- scripts/load
- lib
- spec/load
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
57 | 106 | | |
58 | 107 | | |
59 | 108 | | |
| |||
0 commit comments