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

Performance issue on pulls list API endpoint with lots of PR's #30483

Open
42wim opened this issue Apr 14, 2024 · 0 comments · May be fixed by #30490
Open

Performance issue on pulls list API endpoint with lots of PR's #30483

42wim opened this issue Apr 14, 2024 · 0 comments · May be fixed by #30490
Labels
performance/speed performance issues with slow downs topic/api Concerns mainly the API

Comments

@42wim
Copy link
Member

42wim commented Apr 14, 2024

Description

We're running renovatebot and were getting timeouts (and renovatebot crashes) because the api/v1/repos/{owner}/{repo}/pulls?state=all endpoint is taking too long on repos with lots of PR's > 3k ( this takes almost 2 minutes, also the repo's are on NFS)

I've traced the issue to the ToAPIPullRequest function

func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *user_model.User) *api.PullRequest {

That function is doing git.OpenRepository a couple of times, which for > 3k pr's means it doing this ~ 10k times.
I'm not sure how to solve this, maybe it's possible to directly add extra keys to the PullRequest model so they don't need to be queried live or adding a separate cache for this ?

Gitea Version

1.21.10

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?

Using gitea docker image

Database

MySQL/MariaDB

@42wim 42wim added the type/bug label Apr 14, 2024
@yp05327 yp05327 added performance/speed performance issues with slow downs topic/api Concerns mainly the API and removed type/bug labels Apr 15, 2024
@lunny lunny linked a pull request Apr 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance/speed performance issues with slow downs topic/api Concerns mainly the API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants