go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.08k stars 5.41k forks source link

repos/pulls api take long time for large repos #31492

Open GammaGames opened 2 months ago

GammaGames commented 2 months ago

Description

I'm working with renovate which makes calls to api/v1/repos/org/repo/pulls?state=all&sort=recentupdate&page=[page]. At pages 8+ the requests take a long time. Looking at htop it's because the git diff command is blocking. This is likely because my repo had a large restructure, loading the diffs on the gitea web app is also very slow.

/usr/bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= diff --shortstat [left]...[right]

Is there any way to cache diffs or any config I can use to speed them up? My current workaround is to set the request timeout to 5 min in renovate

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/GammaGames/b1ae6715c8a66da638ee181ed6f93da1

Screenshots

image

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker compose:

services:
  gitea:
    image: gitea/gitea:1
    container_name: gitea
    environment:
      USER_UID: 1001
      USER_GID: 1001
    restart: unless-stopped
    volumes:
      - ./gitea:/data
    ports:
      - 127.0.0.1:3001:3000
      - 127.0.0.1:2222:22

Database

SQLite

xoxys commented 1 month ago

Facing the same issue while using Postgres.