Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gogs page load very slow. #2838

Closed
wenerme opened this issue Mar 16, 2016 · 40 comments
Closed

Gogs page load very slow. #2838

wenerme opened this issue Mar 16, 2016 · 40 comments

Comments

@wenerme
Copy link

wenerme commented Mar 16, 2016

Problem

© 2016 Gogs 当前版本: 0.9.0.0306 页面: 44119ms 模板: 20ms

Config

APP_NAME = <REMOVED>
RUN_USER = root
RUN_MODE = prod

[database]
DB_TYPE = sqlite3
HOST = 127.0.0.1:3306
NAME = gogs
USER = root
PASSWD =
SSL_MODE = disable
PATH = data/gogs.db

[repository]
ROOT = ./repositories

[server]
DOMAIN = <REMOVED>
HTTP_PORT = 3000
ROOT_URL = <REMOVED>
DISABLE_SSH = false
SSH_PORT = 3022
OFFLINE_MODE = true
ENABLE_GZIP= true
[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
DISABLE_REGISTRATION = false
ENABLE_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = false

[picture]
DISABLE_GRAVATAR = true

[session]
PROVIDER = file

[log]
MODE = file
LEVEL = Info

[security]
INSTALL_LOCK = true
SECRET_KEY = <REMOVED>

Download from main site.

System status

# cat /etc/redhat-release
CentOS release 6.5 (Final)
Tasks: 252 total,   1 running, 251 sleeping,   0 stopped,   0 zombie
Cpu(s): 25.2%us,  0.5%sy,  0.0%ni, 74.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  10127364k total,  9907780k used,   219584k free,    82332k buffers
Swap: 16777208k total,   270980k used, 16506228k free,  7425212k cached

Request log

[Macaron] Started GET <REMOVED> for <REMOVED>
2016/03/15 22:57:57 [D] Session ID: d7d1dad0f55f2384
2016/03/15 22:57:57 [D] CSRF Token: 7U3nCPkyzHhXpMxifg5i3Nb2rqU6MTQ1ODAwNDAyMzY2MjY0ODc0OA==
2016/03/15 22:58:41 [D] Template: repo/home
[Macaron] Completed /<REMOVED> 200 OK in 44.125287281s
[Macaron] Started GET /js/jquery-1.11.3.min.js for <REMOVED>
[Macaron] [Static] Serving /js/jquery-1.11.3.min.js
[Macaron] Completed /js/jquery-1.11.3.min.js 304 Not Modified in 204.296µs
[Macaron] Started GET /assets/font-awesome-4.5.0/css/font-awesome.min.css for <REMOVED>
[Macaron] [Static] Serving /assets/font-awesome-4.5.0/css/font-awesome.min.css
[Macaron] Completed /assets/font-awesome-4.5.0/css/font-awesome.min.css 304 Not Modified in 91.553µs
[Macaron] Started GET /assets/octicons-3.4.1/octicons.css for <REMOVED>
[Macaron] [Static] Serving /assets/octicons-3.4.1/octicons.css
[Macaron] Completed /assets/octicons-3.4.1/octicons.css 304 Not Modified in 231.45µs
[Macaron] Started GET /css/semantic-2.1.8.min.css for <REMOVED>
[Macaron] [Static] Serving /css/semantic-2.1.8.min.css
[Macaron] Completed /css/semantic-2.1.8.min.css 304 Not Modified in 98.953µs
[Macaron] Started GET /css/gogs.css?v=6c7b6aaa14b8021627f64f47e6932264 for <REMOVED>
[Macaron] [Static] Serving /css/gogs.css
[Macaron] Completed /css/gogs.css?v=6c7b6aaa14b8021627f64f47e6932264 304 Not Modified in 148.477µs
[Macaron] Started GET /js/semantic-2.1.8.min.js for <REMOVED>
[Macaron] [Static] Serving /js/semantic-2.1.8.min.js
[Macaron] Completed /js/semantic-2.1.8.min.js 304 Not Modified in 76.887µs
[Macaron] Started GET /js/gogs.js?v=6c7b6aaa14b8021627f64f47e6932264 for <REMOVED>
[Macaron] [Static] Serving /js/gogs.js
[Macaron] Completed /js/gogs.js?v=6c7b6aaa14b8021627f64f47e6932264 304 Not Modified in 79.46µs
[Macaron] Started GET /plugins/highlight-9.1.0/github.css for <REMOVED>
[Macaron] [Static] Serving /plugins/highlight-9.1.0/github.css
[Macaron] Completed /plugins/highlight-9.1.0/github.css 304 Not Modified in 172.073µs
[Macaron] Started GET /plugins/highlight-9.1.0/highlight.pack.js for <REMOVED>
[Macaron] [Static] Serving /plugins/highlight-9.1.0/highlight.pack.js
[Macaron] Completed /plugins/highlight-9.1.0/highlight.pack.js 304 Not Modified in 274.935µs
[Macaron] Started GET /js/libs/emojify-1.1.0.min.js for <REMOVED>
[Macaron] [Static] Serving /js/libs/emojify-1.1.0.min.js
[Macaron] Completed /js/libs/emojify-1.1.0.min.js 304 Not Modified in 116.507µs
[Macaron] Started GET /js/libs/clipboard-1.5.5.min.js for <REMOVED>
[Macaron] [Static] Serving /js/libs/clipboard-1.5.5.min.js
[Macaron] Completed /js/libs/clipboard-1.5.5.min.js 304 Not Modified in 106.534µs
[Macaron] Started GET /img/favicon.png for <REMOVED>
[Macaron] [Static] Serving /img/favicon.png
[Macaron] Completed /img/favicon.png 304 Not Modified in 217.58µs
[Macaron] Started GET /avatars/1 for <REMOVED>
[Macaron] [Static] Serving /1
[Macaron] Completed /avatars/1 304 Not Modified in 85.737µs
[Macaron] Started GET /img/avatar_default.jpg for <REMOVED>
[Macaron] [Static] Serving /img/avatar_default.jpg
[Macaron] Completed /img/avatar_default.jpg 304 Not Modified in 254.087µs
[Macaron] Started GET /css/themes/default/assets/fonts/icons.woff2 for <REMOVED>
[Macaron] [Static] Serving /css/themes/default/assets/fonts/icons.woff2
[Macaron] Completed /css/themes/default/assets/fonts/icons.woff2 304 Not Modified in 219.824µs
[Macaron] Started GET /img/favicon.png for <REMOVED>
[Macaron] [Static] Serving /img/favicon.png
[Macaron] Completed /img/favicon.png 200 OK in 2.093003ms
[Macaron] Started GET /ideal-log/mq-usecase-doc for 10.4.231.185
...
2016/03/15 23:05:23 [D] Session ID: d7d1dad0f55f2384
2016/03/15 23:05:23 [D] CSRF Token: 7U3nCPkyzHhXpMxifg5i3Nb2rqU6MTQ1ODAwNDAyMzY2MjY0ODc0OA==
2016/03/15 23:06:01 [D] Template: repo/home
[Macaron] Completed <REMOVED> 200 OK in 38.050006334s
...
[Macaron] Started GET <REMOVED>  for 10.4.231.185
2016/03/15 23:06:51 [D] Session ID: d7d1dad0f55f2384
2016/03/15 23:06:51 [D] CSRF Token: 7U3nCPkyzHhXpMxifg5i3Nb2rqU6MTQ1ODAwNDAyMzY2MjY0ODc0OA==
2016/03/15 23:07:28 [D] Template: repo/home
[Macaron] Completed /ideal-log/mq-usecase-doc 200 OK in 36.58376736s
...

image

@unknwon
Copy link
Member

unknwon commented Mar 16, 2016

Duplicated to #1518?

@unknwon unknwon added the status: needs feedback Tell me more about it label Mar 16, 2016
@wenerme
Copy link
Author

wenerme commented Mar 16, 2016

Not sure is this the same as #1518

This is a very small repo

image

But still

© 2016 Gogs 当前版本: 0.9.0.0306 页面: 4878ms 模板: 6ms

@unknwon
Copy link
Member

unknwon commented Mar 16, 2016

How long for you to execute git log -1 on any repo in the same machine?

@wenerme
Copy link
Author

wenerme commented Mar 16, 2016

Same machine, under the gogs's repo dir

# time git log -1 > /dev/null

real    0m0.004s
user    0m0.001s
sys 0m0.003s

@unknwon
Copy link
Member

unknwon commented Mar 16, 2016

How about other pages?

@wenerme
Copy link
Author

wenerme commented Mar 16, 2016

Other page is normal, the sub dir of repo is also slow,but better than the repo home page.

@unknwon
Copy link
Member

unknwon commented Mar 16, 2016

Can you change RUN_MODE to dev and [log] LEVEL = Trace then dump log here again?

@wenerme
Copy link
Author

wenerme commented Mar 16, 2016

[Macaron] Started GET /<ORG>/<REPO> for <IP>
2016/03/16 00:13:08 [D] Session ID: d7d1dad0f55f2384
2016/03/16 00:13:08 [D] CSRF Token: 5H0bXgybHAjGnBqr4n6dR98odZg6MTQ1ODA5ODI3ODQ0MDc3Njg1MQ==
[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git tag -l
[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git show-ref --heads
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749 refs/heads/master

[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git show-ref --verify refs/heads/master
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749 refs/heads/master

[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git show-ref --verify refs/heads/master
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749 refs/heads/master

[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git show-ref --verify refs/heads/master
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749 refs/heads/master

[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git cat-file -p 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] stdout:
tree 4a8f886b47b6336d3b3b668c8dd0faba7a616a67
parent 2f15774ce791802558e8c2363757598051a93b3e
author wener <<MAIL>> 1458099228 +0800
committer wener <<MAIL>> 1458099228 +0800

add all

[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log --pretty=format:'' 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] stdout:
''
''
[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git ls-tree 4a8f886b47b6336d3b3b668c8dd0faba7a616a67
[git-module] stdout:
100644 blob cb30e1daf9fe71fe6943c6a2c268a0758e461625    .DS_Store
100644 blob 74129ce499f4583c5e333c4861fac9c5c7b595d7    README.md
100755 blob dfc9f6206abbe9e7874c0f31b65c73e1bea1e9e3    ansible.cfg
100755 blob 0ba7e34ba3dd2a69f067898504a3a6ef2787bac3    clean.yml
100755 blob 8be6884e30c5752b0578200dcde47f1b5ffde4f1    deploy-full.yml
100755 blob 02b900d7d5ebfbcee85850e461ea1c7d544413c0    deploy.yml
040000 tree 93ba1c584a1651957c0a5937a300fd2ab122a77d    files
040000 tree d5924334daeec4c28423b981663f34515fed0a78    group_vars
100755 blob 69e62abc4be401e3257f7c6313561c405defad51    localhost.ini
040000 tree 22a58c205d6f4b40a69ea23511e75fb0e14dbb26    roles
100755 blob b6c72534139e71b3698d5ca42d04580008d3f78d    stop.yml
040000 tree 53fca8b4b3b144dab662f70ff2fae77c2fa5a014    templates

[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- deploy.yml
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- group_vars
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] [git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- .DS_Store
/home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- files
[git-module] [git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- localhost.ini
[git-module] [git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- templates
[git-module] [git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- ansible.cfg
/home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- deploy-full.yml
[git-module] [git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- roles
stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- clean.yml
[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- stop.yml
Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
/home/apps/gogs/repositories/<ORG>/<REPO>.git: git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- README.md
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] [git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] [git-module] Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] [git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] [git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] stdout:
18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] Hit cache: 18e1bb0a2d2f90869e8eda7ba977f378b29a8749
[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git show 74129ce499f4583c5e333c4861fac9c5c7b595d7
[git-module] stdout:
<CONTENT>

[git-module] /home/apps/gogs/repositories/<ORG>/<REPO>.git: git cat-file -s 74129ce499f4583c5e333c4861fac9c5c7b595d7
[git-module] stdout:
424

2016/03/16 00:13:16 [D] Template: repo/home
[Macaron] Completed /<ORG>/<REPO> 200 OK in 7.983778177s
[Macaron] Started GET /js/jquery-1.11.3.min.js for <IP>
[Macaron] [Static] Serving /js/jquery-1.11.3.min.js
[Macaron] Completed /js/jquery-1.11.3.min.js 304 Not Modified in 601.822µs
[Macaron] Started GET /assets/font-awesome-4.5.0/css/font-awesome.min.css for <IP>
[Macaron] [Static] Serving /assets/font-awesome-4.5.0/css/font-awesome.min.css
[Macaron] Started GET /assets/octicons-3.4.1/octicons.css for <IP>
[Macaron] Completed /assets/font-awesome-4.5.0/css/font-awesome.min.css 304 Not Modified in 1.595743ms
[Macaron] [Static] Serving /assets/octicons-3.4.1/octicons.css
[Macaron] Completed /assets/octicons-3.4.1/octicons.css 304 Not Modified in 6.684012ms
[Macaron] Started GET /css/semantic-2.1.8.min.css for <IP>
[Macaron] [Static] Serving /css/semantic-2.1.8.min.css
[Macaron] Completed /css/semantic-2.1.8.min.css 304 Not Modified in 26.916429ms
[Macaron] Started GET /js/semantic-2.1.8.min.js for <IP>
[Macaron] Started GET /css/gogs.css?v=6c7b6aaa14b8021627f64f47e6932264 for <IP>
[Macaron] [Static] Serving /css/gogs.css
[Macaron] Completed /css/gogs.css?v=6c7b6aaa14b8021627f64f47e6932264 304 Not Modified in 48.560087ms
[Macaron] [Static] Serving /js/semantic-2.1.8.min.js
[Macaron] Completed /js/semantic-2.1.8.min.js 304 Not Modified in 56.930405ms
[Macaron] Started GET /plugins/highlight-9.1.0/highlight.pack.js for <IP>
[Macaron] [Static] Serving /plugins/highlight-9.1.0/highlight.pack.js
[Macaron] Started GET /js/gogs.js?v=6c7b6aaa14b8021627f64f47e6932264 for <IP>
[Macaron] [Static] Serving /js/gogs.js
[Macaron] Completed /plugins/highlight-9.1.0/highlight.pack.js 304 Not Modified in 24.676528ms
[Macaron] Completed /js/gogs.js?v=6c7b6aaa14b8021627f64f47e6932264 304 Not Modified in 19.273344ms
[Macaron] Started GET /js/libs/emojify-1.1.0.min.js for <IP>
[Macaron] [Static] Serving /js/libs/emojify-1.1.0.min.js
[Macaron] Completed /js/libs/emojify-1.1.0.min.js 304 Not Modified in 179.722µs
[Macaron] Started GET /img/favicon.png for <IP>
[Macaron] Started GET /js/libs/clipboard-1.5.5.min.js for <IP>
[Macaron] [Static] Serving /img/favicon.png
[Macaron] [Static] Serving /js/libs/clipboard-1.5.5.min.js
[Macaron] Completed /img/favicon.png 304 Not Modified in 9.251991ms
[Macaron] Completed /js/libs/clipboard-1.5.5.min.js 304 Not Modified in 7.468323ms
[Macaron] Started GET /plugins/highlight-9.1.0/github.css for <IP>
[Macaron] [Static] Serving /plugins/highlight-9.1.0/github.css
[Macaron] Completed /plugins/highlight-9.1.0/github.css 304 Not Modified in 5.555471ms
[Macaron] Started GET /plugins/highlight-9.1.0/highlight.pack.js for <IP>
[Macaron] [Static] Serving /plugins/highlight-9.1.0/highlight.pack.js
[Macaron] Completed /plugins/highlight-9.1.0/highlight.pack.js 304 Not Modified in 2.245388ms
[Macaron] Started GET /avatars/1 for <IP>
[Macaron] [Static] Serving /1
[Macaron] Started GET /img/avatar_default.jpg for <IP>
[Macaron] [Static] Serving /img/avatar_default.jpg
[Macaron] Completed /img/avatar_default.jpg 304 Not Modified in 2.078824ms
[Macaron] Completed /avatars/1 304 Not Modified in 3.118837ms
[Macaron] Started GET /assets/octicons-3.4.1/octicons.woff for <IP>
[Macaron] [Static] Serving /assets/octicons-3.4.1/octicons.woff
[Macaron] Completed /assets/octicons-3.4.1/octicons.woff 304 Not Modified in 91.082µs
[Macaron] Started GET /css/themes/default/assets/fonts/icons.woff2 for <IP>
[Macaron] [Static] Serving /css/themes/default/assets/fonts/icons.woff2
[Macaron] Completed /css/themes/default/assets/fonts/icons.woff2 304 Not Modified in 226.445µs
[Macaron] Started GET /img/favicon.png for <IP>
[Macaron] [Static] Serving /img/favicon.png
[Macaron] Completed /img/favicon.png 200 OK in 5.388847ms

@unknwon
Copy link
Member

unknwon commented Mar 16, 2016

Thanks, can you try some of the commands in the log, see if they are slow?

Such as at directory /home/apps/gogs/repositories/<ORG>/<REPO>.git and do git show 74129ce499f4583c5e333c4861fac9c5c7b595d7.

@wenerme
Copy link
Author

wenerme commented Mar 16, 2016

I extract all commands to cmds

# time sh cmds
real    0m0.535s
user    0m0.093s
sys 0m0.166s
# cat cmds|grep .
git tag -l
git show-ref --heads
git ls-tree 4a8f886b47b6336d3b3b668c8dd0faba7a616a67
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- group_vars
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- .DS_Store
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- files
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- localhost.ini
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- templates
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- ansible.cfg
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- deploy-full.yml
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- roles
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- clean.yml
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- stop.yml
git log -1 --pretty=format:%H 18e1bb0a2d2f90869e8eda7ba977f378b29a8749 -- README.md
git show 74129ce499f4583c5e333c4861fac9c5c7b595d7

BTW, the git show need a q to exit the interactive mode.

@unknwon
Copy link
Member

unknwon commented Mar 16, 2016

Other page is normal, the sub dir of repo is also slow,but better than the repo home page.

What is your definition of normal?

@wenerme
Copy link
Author

wenerme commented Mar 16, 2016

Pages like this that not include repos

/<ORG>
/issues
/pulls
/<USER>
/

About 200m avg.

Notice this is also slow

/<ORG>/<REPO>
                            /settings
                            /settings/collaboration

Even a un init repo will took 1s, after a refresh took ~5s
image

@unknwon
Copy link
Member

unknwon commented Mar 16, 2016

How did you install Gogs?

@wenerme
Copy link
Author

wenerme commented Mar 16, 2016

# URL from https://gogs.io/docs/installation/install_from_binary
# Use the CDN
wget http://7d9nal.com2.z0.glb.qiniucdn.com/gogs_v0.9.0_linux_amd64.zip
unzip gogs_v0.9.0_linux_amd64.zip

@unknwon
Copy link
Member

unknwon commented Mar 16, 2016

Can you try MySQL as backend?

@wenerme
Copy link
Author

wenerme commented Mar 16, 2016

I don't have MySQL now,this is company internal server.

@unknwon
Copy link
Member

unknwon commented Mar 16, 2016

OK.... then try install from source code with SQLite3: https://gogs.io/docs/installation/install_from_source

@unknwon
Copy link
Member

unknwon commented Mar 19, 2016

ping @wenerme

@wenerme
Copy link
Author

wenerme commented Mar 23, 2016

Use gogs installed from source will look template and conf from /root/go/bin

2016/03/22 21:48:39 [W] Custom config '/root/go/bin/custom/conf/app.ini' not found, ignore this if you're running first time
2016/03/22 21:46:43 [...gits/gogs/cmd/web.go:73 checkVersion()] [E] Fail to read 'templates/.VERSION': open /root/go/bin/templates/.VERSION: no such file or directory

After I copy the templates to /root/go/bin/, the 2nd error gone.

# ls
custom  gogs     log        public     README_ZH.md  scripts  templates
data    LICENSE  nohup.out  README.md  repositories  source

I can start the server by

# gogs web -c "/home/apps/gogs/custom/conf/app.ini"
2016/03/22 21:54:32 [T] Custom path: /root/go/bin/custom
2016/03/22 21:54:32 [T] Log path: /root/go/bin/log

image

but the web page is broker. event gogs web is also broker.

# gogs web
2016/03/22 21:56:07 [W] Custom config '/root/go/bin/custom/conf/app.ini' not found, ignore this if you're running first time
2016/03/22 21:56:07 [T] Custom path: /root/go/bin/custom
2016/03/22 21:56:07 [T] Log path: /root/go/bin/log

image

# gogs -version
Gogs version 0.9.13.0319

@unknwon
Copy link
Member

unknwon commented Mar 23, 2016

You did not copy public directory.

@wenerme
Copy link
Author

wenerme commented Mar 23, 2016

Event started with gogs web -c "/home/apps/gogs/custom/conf/app.ini", git pull will return

fatal: http://10.4.247.251:3000/x/y.git/info/refs not valid: is this a git repository?

@unknwon
Copy link
Member

unknwon commented Mar 23, 2016

Because you did not set config point to right path for ROOT_PATH.

Regardless of this error, how long it takes to open repository home page?

@wenerme
Copy link
Author

wenerme commented Mar 23, 2016

4 commits, dev mode , trace log

© 2016 Gogs 当前版本: 0.9.13.0319 页面: 28553ms 模板: 9481ms

277 commits

© 2016 Gogs 当前版本: 0.9.13.0319 页面: 63925ms 模板: 26206ms

@unknwon
Copy link
Member

unknwon commented Mar 23, 2016

I think it's more or less the problem with the system and Go, even templating takes so long.

@wenerme
Copy link
Author

wenerme commented Mar 23, 2016

Should I try to upgrade my git ?

$ git --version
git version 1.7.1

@unknwon
Copy link
Member

unknwon commented Mar 23, 2016

I suggest you change a machine with same system and try again.

@wenerme
Copy link
Author

wenerme commented Mar 23, 2016

Home page is fast when there is no other page request

© 2016 Gogs 当前版本: 0.9.13.0319 页面: 436ms 模板: 417ms

@wenerme
Copy link
Author

wenerme commented Mar 23, 2016

Move to a new server ,save git version, it's way more faster

277 commits

© 2016 Gogs 当前版本: 0.9.13.0319 页面: 1376ms 模板: 411ms

@wenerme
Copy link
Author

wenerme commented Mar 23, 2016

Still don't know why this happen, but I will move on, thanks.

@unknwon
Copy link
Member

unknwon commented Mar 23, 2016

Exact same system version?

@wenerme
Copy link
Author

wenerme commented Mar 23, 2016

Yes, centos 6.5

@unknwon
Copy link
Member

unknwon commented Mar 23, 2016

OK, sounds like environment issue.

We can move discussion to https://discuss.gogs.io/ and I'm closing this one.

@unknwon unknwon closed this as completed Mar 23, 2016
@wenerme
Copy link
Author

wenerme commented Mar 23, 2016

Ok, thanks for your patient.

@unknwon unknwon removed the status: needs feedback Tell me more about it label Mar 23, 2016
@AysadKozanoglu
Copy link

i have also the problem that gogs web und git push are very slow (waiting of something)

on fresh debian 8.8 jessie i started ./gogs from the extracted .tar.gz than i open the regular link http://:3000

gogs needs Page: 40071ms Template: 30031ms
Gogs Version: 0.11.19.0609 Page: 40071ms Template: 30031ms

i can not solve the issue with the performance. debian and gogs are fresh installed (nothing else) all settings are by default.

@AysadKozanoglu
Copy link

AysadKozanoglu commented Jul 30, 2017

i solved my issue by looking logs. gogs try to solve the avatar/gravatar against (@gmail or what else you type) and hangs :-)

on first gogs installation i disabled the avatar. now it is very quickly ;-)

thanks a lot for all gogs developers that i can use so nice open source solution.

@AddoSolutions
Copy link

I had the same issue as AysadKozanoglu

2017/09/28 02:22:12 [ WARN] AvatarLink.LibravatarService.FromEmail [me@mydomain.com]: lookup _avatars-sec._tcp.mydomain.com on 10.10.1.1:53: read udp 172.17.0.12:53509->10.0.0.2:53: i/o timeout

Any idea why it would be loading at a 172.16.0.0/14 address? Or is this something I should open a new issue for?

@unknwon
Copy link
Member

unknwon commented Oct 12, 2017

@AysadKozanoglu I think you can disable this option to solve this problem.

@u571kills
Copy link

Just an update for anyone else with "slow page loading" on initial install.
The root cause for me was broken DNS inside my Docker image / network.

ethantkoenig pushed a commit to ethantkoenig/gogs that referenced this issue Nov 10, 2017
* Translator pt-BR

* rectification translators pt-BR
9999years pushed a commit to 9999years/gogs that referenced this issue Mar 29, 2018
It's a fun feature but `ENABLE_FEDERATED_AVATAR` being true by default
leads to confusion and huge slowdowns (see gogs#2838, gogs#980, gogs#914) --- it's
unexpected that Gogs requires DNS configured (?) for avatars.

Avatar lookup is a niche feature that I don't believe should be enabled
by default given how prone it is to causing problems.
9999years pushed a commit to 9999years/gogs that referenced this issue Mar 29, 2018
It's a fun feature but `ENABLE_FEDERATED_AVATAR` being true by default
leads to confusion and huge slowdowns (see gogs#2838, gogs#980, gogs#914) --- it's
unexpected that Gogs requires DNS configured (?) for avatars.

Avatar lookup is a niche feature that I don't believe should be enabled
by default given how prone it is to causing problems.
unknwon pushed a commit that referenced this issue Mar 29, 2018
It's a fun feature but `ENABLE_FEDERATED_AVATAR` being true by default
leads to confusion and huge slowdowns (see #2838, #980, #914) --- it's
unexpected that Gogs requires DNS configured (?) for avatars.

Avatar lookup is a niche feature that I don't believe should be enabled
by default given how prone it is to causing problems.
@MohammedFadin
Copy link

@u571kills can you explain more how broken? I'm using the default settings.

@LennyLip
Copy link

LennyLip commented Jan 7, 2022

Same issue with the latest docker:

Screenshot 2022-01-07 at 12 13 18

Pages working ok, but sometimes stop loading (ERR_TIMED_OUT) or take ~1 min to load. it can be any page (home, admin settings, repo)

gogs: Version 0.13.0+dev 2021-05-19 07:16:50 UTC

[server]
OFFLINE_MODE     = true
[picture]
DISABLE_GRAVATAR        = true
ENABLE_FEDERATED_AVATAR = false

update docker updated to 2022-01-05 02:04:04 UTC build - the same issue

CPU loads: 0%

some logs

2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
2022/01/07 09:40:52 [TRACE] Detected encoding: UTF-8 (fast)
.....

update2.

  • The same page/URL can be slow and fast (after refresh page) simultaneously
  • It happened for anon or logged-in users.

conclusion. migrated to gitea docker - work fine out of a box.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants