docs(readme): state which planning socket messages close it

Refs #323

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nessarandClaude Opus 5.5 authored and Nessar committed 2026-10-30 19:10:45 +01:00
1 parent 1df34e4acb
commit aea16d29f2
1 file changed
+1 -1
+1 -1
View File
@@ -264,7 +264,7 @@ The server answers `GET` and `HEAD` only (other methods get 405), except at `/ap
The client sends its build identifier in the `build` query parameter; the server closes a socket from a different build (or without one) with code 4409 before sending any message, so that tab calculates locally with its own engine. Each client IP may hold five planning sockets at once. The IP is the `CF-Connecting-IP` header, or the address of the connection when the header is absent. The server closes a sixth socket from the same IP with code 4429 before sending any message, so that tab calculates locally with its own engine; closing a socket frees its place. The server also closes a socket whose incoming message exceeds about 1 MB (WebSocket code 1009, or an abnormal close) without running a calculation. The per-IP limit holds only if the origin accepts traffic from Cloudflare alone: anyone who can reach the origin directly can forge `CF-Connecting-IP` and bypass it.
At most `PLANNING_WORKERS` calculations run at once, each in its own worker; it defaults to half the CPU threads the container reports, which assumes two threads per core, so set it to the physical core count (throughput stops growing there). Other calculations wait in arrival order and the server sends a heartbeat every second so the client keeps waiting; no queue position is shown. A socket joins the line with its first message, so an idle open socket holds no worker. Closing the socket removes a waiting calculation. A waiting plan that its client cancels starts at once, even beyond `PLANNING_WORKERS`, and stops at its first yield with the worker's own cancelled outcome. A running calculation frees its place when it ends, fails or its socket closes. A client may send one job message and, for a plan, one `cancel`; any other message closes the socket with code 1008. Each calculation takes roughly 60 to 150 MB, and the production Compose file (`compose.prod.yml`) sets an 8 GB memory limit with no CPU limit.
At most `PLANNING_WORKERS` calculations run at once, each in its own worker; it defaults to half the CPU threads the container reports, which assumes two threads per core, so set it to the physical core count (throughput stops growing there). Other calculations wait in arrival order and the server sends a heartbeat every second so the client keeps waiting; no queue position is shown. A socket joins the line with its first message, so an idle open socket holds no worker. Closing the socket removes a waiting calculation. A waiting plan that its client cancels starts at once, even beyond `PLANNING_WORKERS`, and stops at its first yield with the worker's own cancelled outcome. A running calculation frees its place when it ends, fails or its socket closes. A client may send one job message and, for a plan, one `cancel`; any other text message before the job ends closes the socket with code 1008 (binary and invalid JSON get 1003 and 1007), and messages after it ends are ignored. Each calculation takes roughly 60 to 150 MB, and the production Compose file (`compose.prod.yml`) sets an 8 GB memory limit with no CPU limit.
Behind a reverse proxy, forward WebSocket upgrades for `/api/planning`; on Nginx Proxy Manager, enable WebSocket support for the host.