diff --git a/docs/hosting/self-hosting.md b/docs/hosting/self-hosting.md index bbe71041931..439c2fe4723 100644 --- a/docs/hosting/self-hosting.md +++ b/docs/hosting/self-hosting.md @@ -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 diff --git a/news/+7261.docs.md b/news/+7261.docs.md deleted file mode 100644 index 3e010f15589..00000000000 --- a/news/+7261.docs.md +++ /dev/null @@ -1 +0,0 @@ -Document how `frontend_path` affects asset URLs and recommend `rx.asset()` for local assets. diff --git a/news/+repeated-request-headers.bugfix.md b/news/+repeated-request-headers.bugfix.md index 75388bfd97a..af8216fc2f5 100644 --- a/news/+repeated-request-headers.bugfix.md +++ b/news/+repeated-request-headers.bugfix.md @@ -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.