-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add slow SQL query warning #27545
Merged
Merged
Add slow SQL query warning #27545
Commits on Oct 9, 2023
-
- Databases are one of the most important parts of Forgejo, every interaction uses the database in one way or another. Therefore, it is important to maintain the database and recognize when the server is not doing well with the database. There already is the option to log *every* SQL query along with its execution time, but monitoring becomes impractical for larger instances and takes up unnecessary storage in the logs. - Add a QoL enhancement that allows instance administrators to specify a threshold value beyond which query execution time is logged as a warning in the xorm logger. The default value is a conservative five seconds to avoid this becoming a source of spam in the logs. - The use case for this patch is that with an instance the size of Codeberg, monitoring SQL logs is not very fruitful and most of them are uninteresting. Recently, in the context of persistent deadlock issues (https://codeberg.org/forgejo/forgejo/issues/220), I have noticed that certain queries hold locks on tables like comment and issue for several seconds. This patch helps to identify which queries these are and when they happen. - Added unit test. (cherry picked from commit 9cf501f1af4cd870221cef6af489618785b71186)
Configuration menu - View commit details
-
Copy full SHA for f7b632c - Browse repository at this point
Copy the full SHA f7b632cView commit details
Commits on Oct 16, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 5923c38 - Browse repository at this point
Copy the full SHA 5923c38View commit details -
Remove tests from "add slow SQL query warning"
This partially reverts commit f7b632c.
Configuration menu - View commit details
-
Copy full SHA for 5468410 - Browse repository at this point
Copy the full SHA 5468410View commit details -
Configuration menu - View commit details
-
Copy full SHA for 41acb65 - Browse repository at this point
Copy the full SHA 41acb65View commit details -
Configuration menu - View commit details
-
Copy full SHA for 438fee9 - Browse repository at this point
Copy the full SHA 438fee9View commit details
Commits on Jan 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 422199c - Browse repository at this point
Copy the full SHA 422199cView commit details
Commits on Feb 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for cc5ccf4 - Browse repository at this point
Copy the full SHA cc5ccf4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39b04fe - Browse repository at this point
Copy the full SHA 39b04feView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.