Skip to content

Conversation

@ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Jun 25, 2024

  • Resolves: #

Summary

session_start and friends can take a long time when the session is locked. This slows down Nextcloud. It might be a good idea to catch when this happens.

  • session_* needs more than 25s -> error
  • session_* needs more than 10s -> warning
  • session_* needs more than 0.5s -> info
  • session_* needs more than 0.1s -> debug

TODO

  • ...

Checklist

@ChristophWurst ChristophWurst force-pushed the fix/session/log-slow-session-calls branch 2 times, most recently from cfd0c07 to 64f35b1 Compare June 26, 2024 06:14
@ChristophWurst
Copy link
Member Author

/backport to stable29

@ChristophWurst ChristophWurst force-pushed the fix/session/log-slow-session-calls branch from 64f35b1 to 6c1d7ea Compare June 26, 2024 13:09
$timeAfter = microtime(true);
$timeSpent = $timeAfter - $timeBefore;
if ($timeSpent > 0.1) {
$logLevel = match (true) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add a function which takes the time list as an argument? :-X
Doing this in so many places already

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how this can be abstracted the best way. The thresholds do not always follow the same pattern. Sometimes it's linear, other times it's exponential.

@ChristophWurst ChristophWurst force-pushed the fix/session/log-slow-session-calls branch from 6c1d7ea to 6fa5011 Compare July 15, 2024 06:54
@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jul 15, 2024
@AndyScherzinger AndyScherzinger added this to the Nextcloud 30 milestone Aug 6, 2024
@ChristophWurst
Copy link
Member Author

Cypress is probably failing for unrelated reasons

@juliusknorr
Copy link
Member

Odd that I cannot merge, but let me rebase again then

Screenshot 2024-08-07 at 09 00 45

@juliusknorr juliusknorr force-pushed the fix/session/log-slow-session-calls branch from e7b15c8 to 2b38d6a Compare August 7, 2024 07:02
@Altahrim Altahrim mentioned this pull request Aug 7, 2024
@juliusknorr juliusknorr disabled auto-merge August 7, 2024 10:43
@juliusknorr juliusknorr merged commit 6cc0827 into master Aug 7, 2024
@juliusknorr juliusknorr deleted the fix/session/log-slow-session-calls branch August 7, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish performance 🚀

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

6 participants