Skip to content

Commit 13668da

Browse files
committed
Clarify renderer warmup docs
1 parent 46ba75a commit 13668da

4 files changed

Lines changed: 16 additions & 14 deletions

File tree

docs/oss/configuration/configuration-pro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ Guidance:
204204
- Account for your Rails concurrency: with many Puma threads/workers all streaming, a renderer with only one or two workers becomes the bottleneck. Scale `workersCount` (and renderer replicas) to your real concurrent streamed-render load.
205205
- Raise `ssr_timeout` for long-running streamed responses — it is the socket idle timeout for the streaming connection. It fires when the renderer sends no data for `ssr_timeout` seconds, not when the total response duration exceeds that value.
206206

207-
### 3. Rails ↔ renderer keep-alive (already on for streaming)
207+
### 3. Rails ↔ renderer keep-alive (persistent on Falcon/async scheduler; per-request on standard Puma)
208208

209209
Connection reuse is automatic when the renderer request runs under a long-lived `Fiber.scheduler`, such as Falcon or Puma configured with an async scheduler. In that setup, the async-http client is stored on the scheduler and reused across streaming requests, so HTTP/2 connections stay alive and renders multiplex over them instead of paying TCP/TLS setup per request (issue #3283). No React on Rails configuration is required to enable this.
210210

211211
Under standard Puma, the streaming helper's `Sync {}` block creates a per-request scheduler. The async-http client is cleaned up when that streaming response ends, so connection reuse does not persist across consecutive Rails requests. The benefit is still meaningful inside a single streamed response: renderer calls in that response can share the same client lifecycle and `renderer_http_pool_size` still bounds concurrent HTTP/2 streams.
212212

213-
`config.renderer_http_keep_alive_timeout` is **deprecated** and ignored: the async-http adapter manages connection lifecycle automatically (connections are reused within the scheduler and cleaned up when it ends). Setting it to a non-`nil` value logs a deprecation warning; setting it to `nil` is silent.
213+
`config.renderer_http_keep_alive_timeout` is **deprecated** and ignored: the async-http adapter manages connection lifecycle automatically (connections are reused within the scheduler and cleaned up when it ends). Setting it to a non-`nil` value logs a deprecation warning; `nil` is accepted silently.
214214

215215
To confirm reuse, compare before/after `responseEnd` timing and streamed RSC performance marks, and trace renderer sockets when you need to distinguish long-lived scheduler reuse from standard Puma's per-request scheduler cleanup.
216216

docs/pro/updating.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,13 +401,14 @@ Before upgrading:
401401
- Expect renderer connection drops to surface immediately as `ReactOnRailsPro::Error`/connection failures. HTTPX
402402
previously performed one implicit transport retry for some connection drops; the async-http adapter uses
403403
`retries: 0` and leaves retry policy to the existing bundle-upload retry loop and caller behavior.
404-
- Run the node renderer client from the normal Rails request path. Async Rails servers or middleware should call the
405-
renderer from inside the request's running scheduler/task context so the async-http client can use scheduler-scoped
406-
connection reuse. Avoid invoking renderer requests from a scheduler-only context that lacks an `Async::Task.current?`
407-
task; that path may still fall back to a nested reactor.
404+
- Run the node renderer client from the normal Rails request path. Async Rails servers (Falcon, Puma with an async
405+
scheduler) are supported: the async-http client uses scheduler-scoped connection reuse automatically. Middleware
406+
should call the renderer from inside the request's running scheduler/task context. Avoid invoking renderer requests
407+
from a scheduler-only context that lacks an `Async::Task.current?` task; that path may still fall back to a nested
408+
reactor.
408409
- `config.renderer_http_keep_alive_timeout` remains accepted for compatibility, but it has no effect because
409410
async-http manages connection lifecycle through its scheduler-scoped clients and ephemeral request clients. Setting
410-
it now emits a deprecation warning.
411+
it to a non-`nil` value emits a deprecation warning; `nil` is accepted silently.
411412

412413
#### Upgrading to 16.4.0 or later
413414

llms-full-pro.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,14 @@ Before upgrading:
602602
- Expect renderer connection drops to surface immediately as `ReactOnRailsPro::Error`/connection failures. HTTPX
603603
previously performed one implicit transport retry for some connection drops; the async-http adapter uses
604604
`retries: 0` and leaves retry policy to the existing bundle-upload retry loop and caller behavior.
605-
- Run the node renderer client from the normal Rails request path. Async Rails servers or middleware should call the
606-
renderer from inside the request's running scheduler/task context so the async-http client can use scheduler-scoped
607-
connection reuse. Avoid invoking renderer requests from a scheduler-only context that lacks an `Async::Task.current?`
608-
task; that path may still fall back to a nested reactor.
605+
- Run the node renderer client from the normal Rails request path. Async Rails servers (Falcon, Puma with an async
606+
scheduler) are supported: the async-http client uses scheduler-scoped connection reuse automatically. Middleware
607+
should call the renderer from inside the request's running scheduler/task context. Avoid invoking renderer requests
608+
from a scheduler-only context that lacks an `Async::Task.current?` task; that path may still fall back to a nested
609+
reactor.
609610
- `config.renderer_http_keep_alive_timeout` remains accepted for compatibility, but it has no effect because
610611
async-http manages connection lifecycle through its scheduler-scoped clients and ephemeral request clients. Setting
611-
it now emits a deprecation warning.
612+
it to a non-`nil` value emits a deprecation warning; `nil` is accepted silently.
612613

613614
#### Upgrading to 16.4.0 or later
614615

llms-full.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18205,13 +18205,13 @@ Guidance:
1820518205
- Account for your Rails concurrency: with many Puma threads/workers all streaming, a renderer with only one or two workers becomes the bottleneck. Scale `workersCount` (and renderer replicas) to your real concurrent streamed-render load.
1820618206
- Raise `ssr_timeout` for long-running streamed responses — it is the socket idle timeout for the streaming connection. It fires when the renderer sends no data for `ssr_timeout` seconds, not when the total response duration exceeds that value.
1820718207

18208-
### 3. Rails ↔ renderer keep-alive (already on for streaming)
18208+
### 3. Rails ↔ renderer keep-alive (persistent on Falcon/async scheduler; per-request on standard Puma)
1820918209

1821018210
Connection reuse is automatic when the renderer request runs under a long-lived `Fiber.scheduler`, such as Falcon or Puma configured with an async scheduler. In that setup, the async-http client is stored on the scheduler and reused across streaming requests, so HTTP/2 connections stay alive and renders multiplex over them instead of paying TCP/TLS setup per request (issue #3283). No React on Rails configuration is required to enable this.
1821118211

1821218212
Under standard Puma, the streaming helper's `Sync {}` block creates a per-request scheduler. The async-http client is cleaned up when that streaming response ends, so connection reuse does not persist across consecutive Rails requests. The benefit is still meaningful inside a single streamed response: renderer calls in that response can share the same client lifecycle and `renderer_http_pool_size` still bounds concurrent HTTP/2 streams.
1821318213

18214-
`config.renderer_http_keep_alive_timeout` is **deprecated** and ignored: the async-http adapter manages connection lifecycle automatically (connections are reused within the scheduler and cleaned up when it ends). Setting it to a non-`nil` value logs a deprecation warning; setting it to `nil` is silent.
18214+
`config.renderer_http_keep_alive_timeout` is **deprecated** and ignored: the async-http adapter manages connection lifecycle automatically (connections are reused within the scheduler and cleaned up when it ends). Setting it to a non-`nil` value logs a deprecation warning; `nil` is accepted silently.
1821518215

1821618216
To confirm reuse, compare before/after `responseEnd` timing and streamed RSC performance marks, and trace renderer sockets when you need to distinguish long-lived scheduler reuse from standard Puma's per-request scheduler cleanup.
1821718217

0 commit comments

Comments
 (0)