This is easy to reproduce. Find a large repository with lots of history and committers. Mirror it to a local Gitea instance. I will use https://git.FreeBSD.org/ports.git since that’s how I was able to produce this behavior.
Depending on how fast/slow your server is you may or may not be able to use the migration tool in the web UI. For me it was timing out. My server is a dual socket Xeon 3.00GHz with 16 GB of RAM on NVMe’s.
I had to do it manually after creating an empty repository with the web UI.
Now try to browse to the repository on your local Gitea instance, ie. https://git.domain.tld/freebsd/ports.git
Note: if you are using an Apache HTTP server as a remote proxy to Gitea you may need to increase the time out with ProxyTimeout. I set mine to 180 seconds.
Look at the process list on your server. You’ll see 100% CPU usage for gitea web while the page continues to load in your browser. Eventually (if the reverse proxy doesn’t timeout) the page is displayed. This is understandable. It’s the first time the large repository is opened in Gitea.
Now refresh the page. It unfortunately takes the same amount of time to load. I would have hoped that some caching would be in use to speed that up.
If I browse in an large project on my local Gitea 1.14.1 instance than it need for the first calls ~6-7 seconds. Than the data will be cached in Memcached and the seconds calls are fast.
My Gitea is running on Intel NUC with an Celeron j5005 CPU, 8GB RAM and SATAIII SSD.
I wonder what else I can do besides increasing the time out. It seems that setting something as high as 720 seconds is still not enough.
Apache Log
[Thu Apr 22 02:16:10.504363 2021] [proxy_http:error] [pid 89063] (70007)The timeout specified has expired: [client X.X.X.X:34526] AH01102: error reading status line from remote server git.domain.tld:3000
[Thu Apr 22 02:16:10.504531 2021] [proxy:error] [pid 89063] [client x.x.x.x:34526] AH00898: Error reading from remote server returned by /freebsd/ports/git-upload-pack
Recent updates have improved only slightly, but the issue still remains. Even though I have Memcached and Redis enabled, it doesn’t seem to make any difference.
It takes almost 2 minutes to render the root of the repo:
Sometimes sub folders just timeout.
The same repo rendered with GitList takes only a second. I get that Gitea is a lot more capable than Gitlist, but I wonder if there something ‘additional’ Gitea is doing that I can disable on a per-repo basis.