Web interface very slow

Recently I’ve noticed that navigating the web interface has become very slow. It varies from click to click and there is no consistency between the speed of different operations. For example:

  • Browsing the paginated list of repositories for a user, one pagination link is instant, the other took ~6s to respond.
  • Open a repository - instant - then opening a small file in that repository - 18s.
  • Open a different repository - 27s - then open a small file in that repository - instant.

During the waiting time the CPU usage is very low. There is tons of disk space and I’ve already followed the advice here: FAQ - Docs. No problems with HTTP/SSH git operations. It’s running on Ubuntu 18.04 and with the repo version of MySQL 5.7.

Does anyone have a suggestion as to how to diagnose this or suggestions to try?

1 Like

Below is a modified version of the log for a 14s request, which was opening a repo. The db query times don’t appear to be the cause of the slow response time.

2022/08/23 09:34:22 1.450434ms models/user/user.go:996:GetUserByIDCtx() [I] 
2022/08/23 09:34:22 500.426µs .../issues/stopwatch.go:132:HasUserStopwatch() [I] 
2022/08/23 09:34:22 698.582µs ...bce556200f/engine.go:1244:Get() [I] 
2022/08/23 09:34:22 398.504µs ...epo/collaboration.go:85:IsCollaborator() [I] 
2022/08/23 09:34:22 459.483µs ...ls/repo/repo_unit.go:218:getUnitsByRepoID() [I] 
2022/08/23 09:34:22 526.265µs ...s/repo/pushmirror.go:93:GetPushMirrorsByRepoID() [I] 
2022/08/23 09:34:22 469.847µs ...ules/context/repo.go:526:RepoAssignment() [I] 
2022/08/23 09:34:22 527.242µs ...ules/context/repo.go:533:RepoAssignment() [I] 
2022/08/23 09:34:22 824.366µs .../organization/org.go:491:GetOrgsCanCreateRepoByUserID() [I] 
2022/08/23 09:34:22 479.326µs models/repo/fork.go:48:GetUserFork() [I] 
2022/08/23 09:34:22 598.721µs models/repo/fork.go:94:FindUserOrgForks() [I] 
2022/08/23 09:34:22 358.326µs ...bce556200f/engine.go:1244:Get() [I] 
2022/08/23 09:34:22 421.409µs models/repo/star.go:71:IsStaring() [I] 
2022/08/23 09:34:22 711.279µs ...ers/web/repo/view.go:741:Home() [I] 
2022/08/23 09:34:22 585.958µs models/repo/topic.go:199:FindTopics() [I] 
2022/08/23 09:34:22 455.361µs models/repo/topic.go:199:FindTopics() [I] 
2022/08/23 09:34:22 574.39µs ...po/language_stats.go:73:GetLanguageStats() [I] 
2022/08/23 09:34:22 500.345µs ...bce556200f/engine.go:1244:Get() [I] 
2022/08/23 09:34:22 541.726µs models/user/user.go:996:GetUserByIDCtx() [I] 
2022/08/23 09:34:22 402.469µs ...bce556200f/engine.go:1244:Get() [I] 
2022/08/23 09:34:22 550.936µs models/user/user.go:996:GetUserByIDCtx() [I] 
2022/08/23 09:34:22 513.516µs ...git/commit_status.go:244:GetLatestCommitStatus() [I] 
2022/08/23 09:34:22 491.142µs ...git/commit_status.go:244:GetLatestCommitStatus() [I] 
2022/08/23 09:34:22 704.499µs ...user/notification.go:39:func1() [I] 
2022/08/23 09:34:22 759.015µs models/user/user.go:996:GetUserByIDCtx() [I]  
2022/08/23 09:34:22 444.329µs .../issues/stopwatch.go:132:HasUserStopwatch() [I] 
2022/08/23 09:34:25 929.514µs ...dels/notification.go:748:GetUIDsAndNotificationCounts() [I]  
2022/08/23 09:34:25 319.957µs .../issues/stopwatch.go:78:GetUIDsAndStopwatch() [I] 
2022/08/23 09:34:35 1.722697ms ...dels/notification.go:748:GetUIDsAndNotificationCounts() [I] 
2022/08/23 09:34:35 347.131µs .../issues/stopwatch.go:78:GetUIDsAndStopwatch() [I] 

I found that the problem goes away if I disable the SSL version of the site on the Apache reverse proxy, and just use plain HTTP. I still don’t know what the problem is but it doesn’t appear to be Gitea.