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/modules
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
..
actions Improve the `issue_comment` workflow trigger event (#29277) 12 months ago
activitypub Upgrade to golangci-lint@v1.55.0 (#27756) 1 year ago
analyze Rename code_langauge.go to code_language.go (#26377) 2 years ago
assetfs Use `Set[Type]` instead of `map[Type]bool/struct{}`. (#26804) 1 year ago
auth Refactor locale&string&template related code (#29165) 12 months ago
avatar Remove nfnt/resize and oliamb/cutter (#25999) 2 years ago
base Use general token signing secret (#29205) 12 months ago
cache Always enable caches (#28527) 1 year ago
charset Refactor locale&string&template related code (#29165) 12 months ago
container Implement FSFE REUSE for golang files (#21840) 2 years ago
context Unify organizations header (#29248) 12 months ago
contexttest Improve user experience for outdated comments (#29050) 1 year ago
csv Refactor locale&string&template related code (#29165) 12 months ago
emoji Update emoji set to Unicode 15 (#25595) 2 years ago
eventsource Final round of `db.DefaultContext` refactor (#27587) 1 year ago
generate Refactor JWT secret generating & decoding code (#29172) 12 months ago
git Discard unread data of `git cat-file` (#29297) 12 months ago
gitgraph More `db.DefaultContext` refactor (#27265) 1 year ago
gitrepo Simplify how git repositories are opened (#28937) 1 year ago
graceful Suggest to use Type=simple for systemd service (#28717) 1 year ago
hcaptcha Consume hcaptcha and pwn deps (#22610) 2 years ago
highlight Add option to disable ambiguous unicode characters detection (#28454) 1 year ago
hostmatcher Support allowed hosts for webhook to work with proxy (#27655) 1 year ago
html Refactor backend SVG package and add tests (#26335) 2 years ago
httpcache Also match weakly validated ETags (#28957) 1 year ago
httplib Less naked returns (#25713) 2 years ago
indexer fix: Elasticsearch: Request Entity Too Large #28117 (#29062) 1 year ago
issue/template Replace `interface{}` with `any` (#25686) 2 years ago
json Replace `interface{}` with `any` (#25686) 2 years ago
label Make label templates have consistent behavior and priority (#23749) 2 years ago
lfs Update tool dependencies (#29030) 1 year ago
log Reduce some allocations in type conversion (#26772) 1 year ago
markup Refactor markup rendering to accept general "protocol:" prefix (#29276) 12 months ago
mcaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
metrics Reduce usage of `db.DefaultContext` (#27073) 1 year ago
migration Refactor locale&string&template related code (#29165) 12 months ago
nosql Update tool dependencies, lock govulncheck and actionlint (#25655) 2 years ago
optional Unify user update methods (#28733) 1 year ago
options Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
packages Propagate install_if and provider_priority to APKINDEX (#28899) 1 year ago
paginator Use more specific test methods (#24265) 2 years ago
pprof Implement FSFE REUSE for golang files (#21840) 2 years ago
private Return `responseText` instead of string in some functions (#28836) 1 year ago
process Replace assert.Fail with assert.FailNow (#27578) 1 year ago
proxy Use proxy for pull mirror (#22771) 2 years ago
proxyprotocol Implement FSFE REUSE for golang files (#21840) 2 years ago
public Refactor CORS handler (#28587) 1 year ago
queue Increase queue length (#27555) 1 year ago
recaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
references Add support for sha256 repositories (#23894) 1 year ago
regexplru Upgrade go dependencies (#25819) 2 years ago
repository Ignore the linux anchor point to avoid linux migrate failure (#29295) 12 months ago
secret Improve decryption failure message (#24573) 2 years ago
session Next round of `db.DefaultContext` refactor (#27089) 1 year ago
setting Add slow SQL query warning (#27545) 12 months ago
sitemap Fix sitemap (#22272) 2 years ago
ssh Remove SSH workaround (#27893) 1 year ago
storage Fix object storage path handling (#27024) 1 year ago
structs Add merge style `fast-forward-only` (#28954) 12 months ago
svg Refactor backend SVG package and add tests (#26335) 2 years ago
sync Implement FSFE REUSE for golang files (#21840) 2 years ago
system Replace more db.DefaultContext (#27628) 1 year ago
templates Refactor more code in templates (#29236) 12 months ago
test Move web/api context related testing function into a separate package (#26859) 1 year ago
testlogger Replace `interface{}` with `any` (#25686) 2 years ago
timeutil Refactor locale&string&template related code (#29165) 12 months ago
translation Improve TrHTML and add more tests (#29228) 12 months ago
turnstile Add new captcha: cloudflare turnstile (#22369) 2 years ago
typesniffer Detect ogg mime-type as audio or video (#26494) 2 years ago
updatechecker Replace more db.DefaultContext (#27628) 1 year ago
upload Implement FSFE REUSE for golang files (#21840) 2 years ago
uri Implement FSFE REUSE for golang files (#21840) 2 years ago
user Implement FSFE REUSE for golang files (#21840) 2 years ago
util Refactor JWT secret generating & decoding code (#29172) 12 months ago
validation Check blocklist for emails when adding them to account (#26812) 1 year ago
web Refactor locale&string&template related code (#29165) 12 months ago
webhook Fix schedule tasks bugs (#28691) 1 year ago