-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
High cpu comsuming cause gitea very slow #15143
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
Comments
I found some related issue. #9642 |
Please update - this is likely fixed by #14649 which is in 1.13.3 |
The latest point release for 1.13 is 1.13.6 - you should always try the latest point release. |
Thank you. |
Closing, please re-open if it remains. |
Please re-open this issue, because after upgrade to 1.13.6 the problem remains. |
what should i do? |
The PR may be small, but does that repo have a long history (i.e. > 10.000 commits)? |
It is very fast if I merge the branch in the local. |
I think pprof would be useful here: [server]
ENABLE_PPROF = true Just before the slow merge please start:
Then do the merge and either attach the profile here or talk to me on discord. I will need to know what version of gitea you are running exactly. We also need logs. Read the issue template. We do not ask for htop as essentially it is useless. Give us some logs and the results of the pprof I've asked for above. |
gitea.0330.log |
@zeripath Can you analyze this problem for me? thank you very much! |
OK you've only sent me the xorm logs which are the least useful logs. Please read: https://docs.gitea.io/en-us/logging-configuration/#debugging-problems. And the profile doesn't actually contain all of the merge - however, it probably does show where the inefficiency is: 43% of the time in that profile is spent in gitea/modules/git/repo_language_stats.go Lines 23 to 91 in 6dfa92b
In particular 27.3% (3.46s) is spent on line 47 above in go-enry.IsVendor: // IsVendor returns whether or not path is a vendor path.
func IsVendor(path string) bool {
return matchRegexSlice(data.VendorMatchers, path)
} Which is remarkably inefficiently written because it simply iterates over a list of regexps checking each one in turn without combining the regexps in to a single regexp. There are a number of other inefficiencies that this flame graph identifies but I think this is a particularly glaring issue. |
`enry.IsVendor` is kinda slow as it simply iterates across all regexps. This PR ajdusts the regexps to combine them to make this process a little quicker. Related go-gitea#15143 Signed-off-by: Andrew Thornton <[email protected]>
@81519434 would it be possible to for you give us a profile file for this push on 1.14-rc2 and master? (I think at least a few things should have been improved even without the isvendor pr I've proposed above but it would be good to know for sure.) |
The high CPU will keep 10-20 minutes after the merge action complete. |
We can see |
`enry.IsVendor` is kinda slow as it simply iterates across all regexps. This PR ajdusts the regexps to combine them to make this process a little quicker. Related #15143 Signed-off-by: Andrew Thornton <[email protected]>
Backport go-gitea#15213 `enry.IsVendor` is kinda slow as it simply iterates across all regexps. This PR ajdusts the regexps to combine them to make this process a little quicker. Related go-gitea#15143 Signed-off-by: Andrew Thornton <[email protected]>
Backport go-gitea#15213 `enry.IsVendor` is kinda slow as it simply iterates across all regexps. This PR ajdusts the regexps to combine them to make this process a little quicker. Related go-gitea#15143 Signed-off-by: Andrew Thornton <[email protected]>
What happens if you create a new repo on the same server, push the original data and open the same pull request? Your git directory (on the server) might be damaged if git itself is very slow. More recent versions of git also contain speedups to the mentioned functions, but it should be a fast operation anyway. |
I will try to upgrade the latest git client verstion, and see if the problem remains. |
`enry.IsVendor` is kinda slow as it simply iterates across all regexps. This PR ajdusts the regexps to combine them to make this process a little quicker. Related go-gitea#15143 Signed-off-by: Andrew Thornton <[email protected]>
@0000005 Has the problem been resolved? Since Gitea 1.16 is coming and a lot of code was changed(improved), I think we can close this one. If there is any performance problem, we can continue to improve on 1.16 |
[x]
):Description
...
I don't know what action will be causing this problem yet. But it happened frequently.
Screenshots
The cpu high usage will last for tens of minutes.
The text was updated successfully, but these errors were encountered: