mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 18:42:43 +01:00
664192767c
- Databases are one of the most important parts of Forgejo, every interaction with Forgejo uses the database in one way or another. Therefore, it is important to maintain the database and recognize when Forgejo is not doing well with the database. Forgejo already has 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 |
||
---|---|---|
.. | ||
_index.en-us.md | ||
_index.zh-cn.md | ||
adding-legal-pages.en-us.md | ||
adding-legal-pages.zh-cn.md | ||
backup-and-restore.en-us.md | ||
backup-and-restore.zh-cn.md | ||
cmd-embedded.en-us.md | ||
cmd-embedded.zh-cn.md | ||
command-line.en-us.md | ||
command-line.zh-cn.md | ||
config-cheat-sheet.en-us.md | ||
config-cheat-sheet.zh-cn.md | ||
customizing-gitea.en-us.md | ||
customizing-gitea.zh-cn.md | ||
email-setup.en-us.md | ||
email-setup.zh-cn.md | ||
environment-variables.en-us.md | ||
environment-variables.zh-cn.md | ||
external-renderers.en-us.md | ||
external-renderers.zh-cn.md | ||
fail2ban-setup.en-us.md | ||
fail2ban-setup.zh-cn.md | ||
git-lfs-support.en-us.md | ||
git-lfs-support.zh-cn.md | ||
https-support.en-us.md | ||
https-support.zh-cn.md | ||
logging-config.en-us.md | ||
logging-config.zh-cn.md | ||
mail-templates.en-us.md | ||
mail-templates.zh-cn.md | ||
repo-indexer.en-us.md | ||
repo-indexer.zh-cn.md | ||
reverse-proxies.en-us.md | ||
reverse-proxies.zh-cn.md | ||
search-engines-indexation.en-us.md | ||
search-engines-indexation.zh-cn.md | ||
signing.en-us.md | ||
signing.zh-cn.md |