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
Please use the 👍 reaction to show that you are interested into the same feature.
Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
Subscribe to receive notifications on status change and new comments.
Is your feature request related to a problem? Please describe.
While debugging some concurrency bugs I noticed that requests from a browser pile up in some scenarios. It seems to be caused by PHP's session locking. This might also have an impact on Nextcloud's overall performance, given that we have lots of pages where we sends a high number of concurrent requests (e.g. for avatars in Talk).
Describe the solution you'd like
Evaluate if the suggestions in https://ma.ttias.be/php-session-locking-prevent-sessions-blocking-in-requests/ can be applied for Nextcloud. I gave it a quick tests, it freed up some of the locking and a few more requests could be processed at a time. I used xdebug to pause the requests intentionally, but a well placed sleep(10); achieves the same effect.
\OC\Session\Internal::startSession has to be adjusted for this.
Read and close might be too limiting by default since we currently always write at least the last activity, but I came up with a slightly different approach to limit the session lock time to only the necessary time slots where the session is actually updated. https://github.com/nextcloud/server/pull/32162/files
How to use GitHub
Is your feature request related to a problem? Please describe.
While debugging some concurrency bugs I noticed that requests from a browser pile up in some scenarios. It seems to be caused by PHP's session locking. This might also have an impact on Nextcloud's overall performance, given that we have lots of pages where we sends a high number of concurrent requests (e.g. for avatars in Talk).
Describe the solution you'd like
Evaluate if the suggestions in https://ma.ttias.be/php-session-locking-prevent-sessions-blocking-in-requests/ can be applied for Nextcloud. I gave it a quick tests, it freed up some of the locking and a few more requests could be processed at a time. I used xdebug to pause the requests intentionally, but a well placed
sleep(10);
achieves the same effect.\OC\Session\Internal::startSession
has to be adjusted for this.What I could not figure out yet is whether this has any negative consequences for our application.
Describe alternatives you've considered
n/a
Additional context
https://www.php.net/manual/en/function.session-start.php, especially the section about this option as well as the comments below that show a few pitfals.
The text was updated successfully, but these errors were encountered: