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
ApiRepositoryContentsControllerBase.scala is very slow (Docker 4.36.1) #2858
Comments
|
@takezoe
The ratio of successful queries with HTTP status 200 is about 40% (request timeout is 10 seconds). |
I confirmed that gitbucket/src/main/scala/ScalatraBootstrap.scala Lines 24 to 26 in ab822a3
Could you provide more information? For example, the following information would be helpful:
Or it would be great if you can provide the step-by-step procedure to reproduce the issue from scratch. |
This is my setup with version: '3'
services:
gitbucket:
image: gitbucket/gitbucket:4.36.1
container_name: gitbucket
ports:
- "80:8080"
volumes:
- "/root/.gitbucket:/gitbucket"
environment:
GITBUCKET_DB_URL: jdbc:mysql://mysql:3306/gitbucket?useUnicode=true&characterEncoding=utf8
GITBUCKET_DB_USER: root
GITBUCKET_DB_PASSWORD: password The repository size is around 56MB, with around 9000 commits.
Request Timeout errors happen when retrieving content via API. It is OK when view raw content via Web URLs. curl --location --request GET 'https://gitbucket.private.com/api/v3/repos/Global/WWW/contents/css/base.css?ref=master' \
--header 'Authorization: token 86086264b87af55e616fea522b783889b6b12230' \
--header 'Accept: application/vnd.github.v3.raw' \ |
Sorry, one more question. Was this error started to happen after upgrading to a particular GitBucket version? or happens even on a fresh GitBucket instance? |
@takezoe |
After digging your source code, i found these parts: ■ This part (for webapp) is good, response is fast: gitbucket/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala Line 664 in ab822a3
▼
■ This part (for API) is much slower: gitbucket/src/main/scala/gitbucket/core/controller/api/ApiRepositoryContentsControllerBase.scala Line 40 in ab822a3
▼ gitbucket/src/main/scala/gitbucket/core/controller/api/ApiRepositoryContentsControllerBase.scala Line 68 in ab822a3
I think using the Hope this helps. |
Ah, yes. That's a known issue also reported in #2674. |
And you have already commented on the PR :-) #2686 (comment) |
@takezoe |
btw,
|
It's |
Issue
Updated on 2021/09/15: I found that ApiRepositoryContentsControllerBase.scala is slow because of Disk I/O.
Impacted version: 4.36.1 (docker)
Deployment mode:
It is OK when viewing file history on webapp.
Fetching resource via API
/api/v3/repos/<user>/<repo>/contents/<path>
got too much errors.Problem description:
The text was updated successfully, but these errors were encountered: