Skip to content

Commit 5701e69

Browse files
authored
[Docs] Recommend persistent Redis connections for sessions on PHP-FPM (#730)
1 parent 9e0f6c9 commit 5701e69

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎docs/run/sessions.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ $server = Server::builder()
211211
->build();
212212
```
213213

214+
!!! warning
215+
With PHP-FPM or Apache mod_php, each request opens new TCP connections to Redis. Under load, the server
216+
can run out of local ports. Symfony Cache logs the connection errors and reports a cache miss, so clients
217+
get HTTP `404` for sessions that still exist. Use a persistent connection: `redis://localhost:6379?persistent=1`.
218+
214219
The lock is held from before a request reads its session until it saved it, so while its handlers run. It
215220
is released when a handler suspends to wait for the client (elicitation, sampling), so the answer's own
216221
request can be processed. The stream that waits for the answer takes the lock briefly on each poll, and only

0 commit comments

Comments
 (0)