forgejo/docs/content/administration
Gusted e636e9f4be
[GITEA] Add slow SQL query warning
- 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 24bbe7886f)
(cherry picked from commit 6e29145b3c)
(cherry picked from commit 63731e3071)
(cherry picked from commit 3ce1a09736)
(cherry picked from commit a64426907d)
(cherry picked from commit 4b19215691)
(cherry picked from commit e635674435)
(cherry picked from commit 9cf501f1af)
(cherry picked from commit 0d6b934eba)
(cherry picked from commit 4b6c273879)
(cherry picked from commit 89b1315338)
(cherry picked from commit edd8e66ce9)

[GITEA] Add slow SQL query warning (squash) document the setting

(cherry picked from commit ce38599c51)
(cherry picked from commit 794aa67c68)
(cherry picked from commit a4c2c6b004)
(cherry picked from commit 97912752bc)
(cherry picked from commit 00b5327c97)
(cherry picked from commit 1069c860e7)
(cherry picked from commit 84241f42c8)
(cherry picked from commit e4bda0e845)
(cherry picked from commit 7357fb91bf)
(cherry picked from commit a8dd7f6da2)
2023-12-25 13:30:06 +01:00
..
_index.en-us.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
_index.zh-cn.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
adding-legal-pages.en-us.md Fix documents for "custom/public/assets/" (#28465) 2023-12-14 08:52:16 +00:00
adding-legal-pages.zh-cn.md Fix documents for "custom/public/assets/" (#28465) 2023-12-14 08:52:16 +00:00
backup-and-restore.en-us.md Update backup instructions to align with archive structure (#26902) 2023-09-05 09:26:12 +08:00
backup-and-restore.zh-cn.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
cmd-embedded.en-us.md Enable markdownlint no-duplicate-header (#27500) 2023-10-07 15:30:21 +02:00
cmd-embedded.zh-cn.md Enable markdownlint no-duplicate-header (#27500) 2023-10-07 15:30:21 +02:00
command-line.en-us.md clarify aspects of the dump command (#26887) 2023-09-03 14:44:01 -04:00
command-line.zh-cn.md Expanded minimum RSA Keylength to 3072 (#26604) 2023-08-28 00:53:16 +00:00
config-cheat-sheet.en-us.md [GITEA] Add slow SQL query warning 2023-12-25 13:30:06 +01:00
config-cheat-sheet.zh-cn.md Make offline mode as default to no connect external avatar service by default (#28548) 2023-12-21 07:42:16 +00:00
customizing-gitea.en-us.md Rename the default themes to gitea-light, gitea-dark, gitea-auto (#27419) 2023-10-06 09:46:36 +02:00
customizing-gitea.zh-cn.md Fix documents for "custom/public/assets/" (#28465) 2023-12-14 08:52:16 +00:00
email-setup.en-us.md Docs: Replace deprecated IS_TLS_ENABLED mailer setting in email setup (#28205) 2023-11-25 10:16:29 +08:00
email-setup.zh-cn.md Fix links in docs (#28234) 2023-11-27 00:34:40 -05:00
environment-variables.en-us.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
environment-variables.zh-cn.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
external-renderers.en-us.md Update documents to fix some links (#26885) 2023-09-03 18:45:20 +00:00
external-renderers.zh-cn.md Fix documents for "custom/public/assets/" (#28465) 2023-12-14 08:52:16 +00:00
fail2ban-setup.en-us.md Use docs.gitea.com instead of docs.gitea.io (#26739) 2023-08-27 11:59:12 +00:00
fail2ban-setup.zh-cn.md Use docs.gitea.com instead of docs.gitea.io (#26739) 2023-08-27 11:59:12 +00:00
git-lfs-support.en-us.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
git-lfs-support.zh-cn.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
https-support.en-us.md Update documents to fix some links (#26885) 2023-09-03 18:45:20 +00:00
https-support.zh-cn.md Fix links in docs (#28302) 2023-12-01 19:42:42 +08:00
logging-config.en-us.md Clarify the logger's MODE config option (#26267) 2023-08-01 18:28:23 +00:00
logging-config.zh-cn.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
mail-templates.en-us.md Use docs.gitea.com instead of docs.gitea.io (#26739) 2023-08-27 11:59:12 +00:00
mail-templates.zh-cn.md Use docs.gitea.com instead of docs.gitea.io (#26739) 2023-08-27 11:59:12 +00:00
repo-indexer.en-us.md Use docs.gitea.com instead of docs.gitea.io (#26739) 2023-08-27 11:59:12 +00:00
repo-indexer.zh-cn.md Use docs.gitea.com instead of docs.gitea.io (#26739) 2023-08-27 11:59:12 +00:00
reverse-proxies.en-us.md Add docs section for sub-paths with the container registry (#27505) 2023-10-09 12:45:41 +08:00
reverse-proxies.zh-cn.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
search-engines-indexation.en-us.md Fix the robots.txt path 2023-10-11 18:01:52 +08:00
search-engines-indexation.zh-cn.md Fix the robots.txt path 2023-10-11 18:01:52 +08:00
signing.en-us.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00
signing.zh-cn.md Docusaurus-ify (#26051) 2023-07-26 04:53:13 +00:00