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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

None yet

4 participants