You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed an issue when enabling persistent sessions using withPersistentSessions(true) in conjunction with PHP-FPM. Specifically, there seems to be a constant growth in the number of connections to the database server.
We are talking about thousands of connections.
(The usable outgoing Ports on the application Server are getting saturaded). We're talking about quiet a bit of load and strong Application Servers. Practically this means that a server is out of ports in about 1-5 Minutes.
It appears that connections are not being cleaned up or closed properly, leading to this buildup over time. If check it in phpinfo persistent connection count is always 1.
I couldn't pinpoint it yet, but disabling persistent sessions didn't resulted in higher latency which leads me to think that it doesn't reuse the connection properly.
(The wrapper is a bit more complex, but this is the gist of it)
$client = new Cassandra()::cluster()
->withContactPoints(implode(',', config('scylla.hosts')))
->withRandomizedContactPoints(true)
->withPersistentSessions(false) // Setting to false helps obviously. => true we see this issue
->build();
$session = $client->connect(config('scylla.keyspace'));
///---- Some Stuff getting executed ---- //
$session?->close(); (Added in conjunction with disabling persistent sessions)
I want to thank also everyone for their hard work on this project—it's incredible helpful!
The text was updated successfully, but these errors were encountered:
K-Leon
changed the title
Persistant Sessions aren't cleaned up or reused properly
Persistent Sessions aren't cleaned up or reused properly
Dec 29, 2024
I've noticed an issue when enabling persistent sessions using withPersistentSessions(true) in conjunction with PHP-FPM. Specifically, there seems to be a constant growth in the number of connections to the database server.
We are talking about thousands of connections.
(The usable outgoing Ports on the application Server are getting saturaded). We're talking about quiet a bit of load and strong Application Servers. Practically this means that a server is out of ports in about 1-5 Minutes.
It appears that connections are not being cleaned up or closed properly, leading to this buildup over time. If check it in phpinfo persistent connection count is always 1.
I couldn't pinpoint it yet, but disabling persistent sessions didn't resulted in higher latency which leads me to think that it doesn't reuse the connection properly.
(The wrapper is a bit more complex, but this is the gist of it)
I want to thank also everyone for their hard work on this project—it's incredible helpful!
The text was updated successfully, but these errors were encountered: