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

Add slow SQL query warning #27545

Merged
merged 8 commits into from
Feb 23, 2024
Merged

Add slow SQL query warning #27545

merged 8 commits into from
Feb 23, 2024

Commits on Oct 9, 2023

  1. add slow SQL query warning

    - 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)
    Gusted authored and earl-warren committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    f7b632c View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. Configuration menu
    Copy the full SHA
    5923c38 View commit details
    Browse the repository at this point in the history
  2. Remove tests from "add slow SQL query warning"

    This partially reverts commit f7b632c.
    earl-warren committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    5468410 View commit details
    Browse the repository at this point in the history
  3. explain why 8

    earl-warren committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    41acb65 View commit details
    Browse the repository at this point in the history
  4. document the setting

    earl-warren committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    438fee9 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2024

  1. Configuration menu
    Copy the full SHA
    422199c View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2024

  1. fix misspell

    6543 committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    cc5ccf4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    39b04fe View commit details
    Browse the repository at this point in the history