From 5a08717d24e021eeec0805b2111c0e3a93e00a34 Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Tue, 10 Nov 2026 18:03:43 +0100 Subject: [PATCH] [Docs] Recommend persistent Redis connections for sessions on PHP-FPM --- docs/run/sessions.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/run/sessions.md b/docs/run/sessions.md index fa4c539b..6229203d 100644 --- a/docs/run/sessions.md +++ b/docs/run/sessions.md @@ -211,6 +211,11 @@ $server = Server::builder() ->build(); ``` +!!! warning + With PHP-FPM or Apache mod_php, each request opens new TCP connections to Redis. Under load, the server + can run out of local ports. Symfony Cache logs the connection errors and reports a cache miss, so clients + get HTTP `404` for sessions that still exist. Use a persistent connection: `redis://localhost:6379?persistent=1`. + The lock is held from before a request reads its session until it saved it, so while its handlers run. It is released when a handler suspends to wait for the client (elicitation, sampling), so the answer's own request can be processed. The stream that waits for the answer takes the lock briefly on each poll, and only