mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-13 02:57:44 -05:00
Extremely slow performance with larger repositories #9001
Closed
opened 2025-11-02 08:25:17 -06:00 by GiteaMirror
·
20 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
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c1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#9001
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vdrandom on GitHub (May 26, 2022).
Description
My department has a repository about 500M in size (bare) and with around 40000 commits in flat history (we don't use branches in that specific repository). It contains about 87000 files. Viewing is generally okay, but an attempt to create a pull request results in 2 minute wait between the button press and new pull request being loaded. In the background I see
git rev-parsebeing run a lot.I tried to reproduce the issue with the Linux Kernel repository (and I get it, THAT one is massive, with more than 4G of data and millions of commits). It took me a few minutes to wait for the repository page to even load, let alone create any pull requests.
I'm not sure it can be fixed, but maybe it is possible to load the pull request page after the press of a button and let the pull request to be created in background at least? It's especially annoying since another press of a button will create another identical pull request and will take as long as the first one.
Gitea Version
1.16.5
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
From gitea.io
Database
SQLite
@lunny commented on GitHub (May 26, 2022):
For big repository, viewing repository maybe slow at first time, but it will be faster second time if cache enabled.
For big pull request, how many files changed in that PR?
@vdrandom commented on GitHub (May 26, 2022):
We often commit less than 10 files, the issue persists regardless of the amount of files involved.
@zeripath commented on GitHub (Aug 2, 2022):
What Operating System are you using?
If you're using Windows try the gogit variant.
What version of git are you using?
Upgrade to the latest git. If you're using old versions of git they're slow.
How did you add this repository?
Was it a mirror or a push? - this matters...
Have made sure that the commit-graphs are written?
Go into gitea's repository on the disk and type
git commit-graph writeWhat are the logs showing?
This report is completely inadequate for helping us to help you.
@wxiaoguang commented on GitHub (Aug 2, 2022):
FYI, there is a linux repo on gitea.com .
And:
(update: above problem has been optimized)
Maybe it's possible to reproduce the problem there (still 504)
https://gitea.com/wxiaoguang/linux/compare/v5.9-rc8...wxiaoguang/linux:wxiaoguang-patch-2
@zeripath commented on GitHub (Aug 5, 2022):
I have a feeling that that repository does not have a commit-graph. I don't have access to the repository on the filesystem to check though.
@zeripath commented on GitHub (Aug 7, 2022):
I think the two urls actually represent different problems.
Let's look at the first one:
This is essentially:
followed-by:
Now both of these would be sped up by commit-graphs. The first call could actually be done entirely within the commit-graph too.
But the interesting thing is that the second one of these is so much slower than the first.
In fact they can actually produce different results due to the
--followon the second call (which appears to be the cause of most of the slow downs.)Now if it were not for
--followwe could actually usegit rev-listfor both of these calls and theskipandmax-countwill be free (in contrast to the current system where the skip doesn't work.)Looking at the history for this line I don't think there was reasoning behind adding the follow except that I would guess that it was nice to add.
So... a simple speed improvement here is to drop the follow and switch to
rev-listfor these calls.An additional speed improvement is to add a context timeout like in the
git log --name-only@vdrandom commented on GitHub (Aug 7, 2022):
I have left the company where this installation was deployed, so I can't provide more context at this point. I've let my former colleagues know about this issue, hopefully the will join the discussion and provide more info or test the suggested solutions.
I'm not really sure why I haven't provided more info on the matter in terms of installation in question, so here it is.
OS Version
Centos 7 (reproduced on ArchLinux)
Git Version
something old, along the lines of 1.8 (reproduced on 2.35 iirc)
Push or mirror?
The repository was initialized with
git --bare push --mirror(same when I tried to reproduce the issue on my laptop). (I might get that command wrong, but I was mirroring a bare repo to the remote installation of gitea.)This is all the info I can provide since I no longer have any access to the servers in question.
@zeripath commented on GitHub (Aug 8, 2022):
OK @vdrandom upgrade git to the latest version and go in to gitea's copy of the repo on the disk and run
git commit-graph write. (If you're on dev/1.18 you can just rungitea doctor --run check-commit-graphs --fix.)git 1.8 is really old and will always be slow on big repos.
Big repos also need commit-graphs written. They should be being written now but old repos will not have them written.
It would be helpful to know exactly which urls are slow after you've done that. (But you must ensure you're running a new version of git.)
If the slow urls are related to diffs you should adjust:
but tell us exactly which urls are slow.
@zeripath commented on GitHub (Aug 8, 2022):
actually it looks like we need
git commit-graph write --changed-paths@lunny commented on GitHub (Aug 15, 2022):
Upgrade gitea.com and now it will take 13 secs in first time loading and less 4 secs in other time when visiting https://gitea.com/marktsai0316/linux/commits/branch/master/scripts/clang-tools .
After manually executed
git commit-graph write --changed-pathsin the server side, now it will take less 5 second in the first time and less 1 second in other time.@zeripath commented on GitHub (Aug 15, 2022):
Ok so it looks like that page could still benefit from a deferable/asynchronous request so I can dust off the code I was working on for that.
I don't think it's worth caching these results as I expect that they should not be being requested often.
I guess I should look at the other URL too
@theoryshaw commented on GitHub (Oct 26, 2022):
We also experience slow performance.
https://hub.openingdesign.com/
@garymoon commented on GitHub (Nov 29, 2022):
Hi all. I've read through the three issues I can find about slow performance on pulls/diffs. I see that the proposed solution is to shift the diffing to an async request. Are there any tips/tricks to be used on the meantime, or partial work on the async change we could take a look at please (@zeripath?)? Any guidance/hints/workarounds would be much appreciated 💙
@zeripath commented on GitHub (Nov 30, 2022):
gitea doctor --run check-commit-graphs --fixWithout logs or some concrete test case we're blind and we don't know what needs to be improved.
@garymoon commented on GitHub (Dec 5, 2022):
Thank you mate. Sorry for the misunderstanding, I assumed since the issue was still open that work was ongoing. The slowness in our case is just due to the scale of some very large PRs, and we're interested in loading the diffs async (ala Github). If there's no code (incomplete or otherwise) to poke at, please consider my reply here withdrawn, and sorry again for the misunderstanding 💙
@zeripath commented on GitHub (Dec 8, 2022):
@garymoon - there's already partial async load - we just load a certain number by default. And that amount is IMO too large.
if you change the
[git]settings I mentioned above that should improve things a lot.If you're after an infinite scroll type thing that would be great and there's practically all of the basic API is there - we'd just have to sort out the JS.
@Sebazzz commented on GitHub (Oct 30, 2023):
For what its worth I have a repo with 10k commits where loading the commit graph takes mere seconds, and I have repositories with barely 1.6k commits where loading the commit graph takes over two minutes. It doesn't necessarily seem dependent on repository size alone.
@lunny commented on GitHub (Oct 30, 2023):
Can you test the second time loading time?
@lunny commented on GitHub (Jan 26, 2024):
As I can see it will only 490ms on the current version. I think this can be closed in a short term if there is no further information.
@GiteaBot commented on GitHub (Feb 25, 2024):
We close issues that need feedback from the author if there were no new comments for a month. 🍵