You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/docs/content
Earl Warren b748d62b46
Add slow SQL query warning (#27545)
- 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)

---------

Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
12 months ago
..
administration Add slow SQL query warning (#27545) 12 months ago
contributing Enable markdownlint `no-trailing-punctuation` and `no-blanks-blockquote` (#29214) 12 months ago
development Enable markdownlint `no-trailing-punctuation` and `no-blanks-blockquote` (#29214) 12 months ago
help Update some translations and fix markdown formatting (#29099) 1 year ago
installation Update some translations and fix markdown formatting (#29099) 1 year ago
usage Support SAML authentication (#25165) 12 months ago
actions.en-us.md Docusaurus-ify (#26051) 2 years ago
administration.en-us.md Docusaurus-ify (#26051) 2 years ago
administration.zh-cn.md Docusaurus-ify (#26051) 2 years ago
contributing.en-us.md Docusaurus-ify (#26051) 2 years ago
development.en-us.md Docusaurus-ify (#26051) 2 years ago
development.zh-cn.md Docusaurus-ify (#26051) 2 years ago
help.en-us.md Docusaurus-ify (#26051) 2 years ago
help.zh-cn.md Docusaurus-ify (#26051) 2 years ago
index.en-us.md Update index doc (#26455) 2 years ago
index.zh-cn.md Update zh-cn documentation (#26406) 2 years ago
installation.en-us.md Docusaurus-ify (#26051) 2 years ago
installation.zh-cn.md Docusaurus-ify (#26051) 2 years ago
packages.en-us.md Docusaurus-ify (#26051) 2 years ago
search.en-us.md Docusaurus-ify (#26051) 2 years ago
search.nl-nl.md Docusaurus-ify (#26051) 2 years ago
search.pt-br.md Docusaurus-ify (#26051) 2 years ago
search.zh-cn.md Docusaurus-ify (#26051) 2 years ago
usage.en-us.md Docusaurus-ify (#26051) 2 years ago
usage.zh-cn.md Docusaurus-ify (#26051) 2 years ago