Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(session): Log when session_* calls are slow #46106

Merged
merged 1 commit into from
Aug 7, 2024

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

$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

@juliushaertl
Copy link
Member

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

Screenshot 2024-08-07 at 09 00 45

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@juliushaertl juliushaertl 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
@juliushaertl juliushaertl merged commit 6cc0827 into master Aug 7, 2024
167 of 169 checks passed
@juliushaertl juliushaertl 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.

5 participants