Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/hosting/self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ from a single server on port `3000`. Pass `--frontend-port` or
the server runs up to 8 backend workers by default (`2 * cpu_count + 1`, capped at 8).
When using Granian, set `GRANIAN_WORKERS` to override the default, including to use more workers.

When using Granian on Linux, backend workers are forked from a supervisor
process that has already imported the app, so they share its memory instead of
each importing the app again. Set `REFLEX_BACKEND_START_METHOD=spawn` (or
`forkserver`) for apps that are not fork-safe, for example ones that open
database connections or start threads at import time. The same variable applies
to the Granian `reflex run` development backend, where `REFLEX_STRICT_HOT_RELOAD=1`
also switches to spawned workers (unless `REFLEX_BACKEND_START_METHOD` is set) so
environment variable changes are picked up on hot reload. Neither variable
affects the Uvicorn backend.

The frontend and backend can also run as separate processes, for example to
serve the frontend from a CDN and scale the backend independently. The
frontend-only server only serves static files, so tell it where the backend
Expand Down
1 change: 0 additions & 1 deletion news/+7261.docs.md

This file was deleted.

2 changes: 1 addition & 1 deletion news/+repeated-request-headers.bugfix.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Repeated request headers are no longer collapsed to their last value: repeated `cookie` fields are joined with `"; "` and any other repeated field with `", "`, so `router.headers.cookie` keeps every cookie and `router.session.client_ip` is taken from the first `x-forwarded-for` hop.
Repeated request headers are no longer collapsed to their last value: repeated `cookie` fields are joined with `"; "` and any other repeated field with `", "`, so `router.headers.cookie` keeps every cookie.
Loading