Slow response on repo/search #12900

Closed
opened 2025-11-02 10:24:21 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @richardbeumer on GitHub (Apr 23, 2024).

Description

After updating Gitea from version 1.21.5 to 1.21.10 performance of repository search is much slower as before. Repo search was near instant and now taking up around 8 seconds.

We are using Elastic as repo indexer.

Logs show:

2024/04/23 12:40:42 ...eb/routing/logger.go:68:func1() [W] router: slow      GET /repo/search?sort=updated&order=desc&uid=11&team_id=undefined&q=bgt&page=1&limit=15&mode=&archived=false for 10.244.2.12:44360, elapsed 3301.6ms @ repo/repo.go:507(repo.SearchRepo)
2024/04/23 12:40:42 ...eb/routing/logger.go:102:func1() [I] router: completed GET /metrics for 10.244.4.12:50702, 200 OK in 220.7ms @ web/metrics.go:16(web.Metrics)

Screenshots

image

Gitea Version

1.21.10

Can you reproduce the bug on the Gitea demo site?

No

Operating System

kubernetes/container image

Browser Version

Chrome 124 / Firefox 125

Originally created by @richardbeumer on GitHub (Apr 23, 2024). ### Description After updating Gitea from version 1.21.5 to 1.21.10 performance of repository search is much slower as before. Repo search was near instant and now taking up around 8 seconds. We are using Elastic as repo indexer. Logs show: ``` 2024/04/23 12:40:42 ...eb/routing/logger.go:68:func1() [W] router: slow GET /repo/search?sort=updated&order=desc&uid=11&team_id=undefined&q=bgt&page=1&limit=15&mode=&archived=false for 10.244.2.12:44360, elapsed 3301.6ms @ repo/repo.go:507(repo.SearchRepo) 2024/04/23 12:40:42 ...eb/routing/logger.go:102:func1() [I] router: completed GET /metrics for 10.244.4.12:50702, 200 OK in 220.7ms @ web/metrics.go:16(web.Metrics) ``` ### Screenshots ![image](https://github.com/go-gitea/gitea/assets/48837088/7a535a3f-62ed-4418-b51c-7664c70ab110) ### Gitea Version 1.21.10 ### Can you reproduce the bug on the Gitea demo site? No ### Operating System kubernetes/container image ### Browser Version Chrome 124 / Firefox 125
GiteaMirror added the performance/speedtopic/uitype/bug labels 2025-11-02 10:24:21 -06:00
Author
Owner

@lunny commented on GitHub (Apr 29, 2024):

The repository name search on dashboard just a database like operation. It's weird.

@lunny commented on GitHub (Apr 29, 2024): The repository name search on dashboard just a database like operation. It's weird.
Author
Owner

@richardbeumer commented on GitHub (May 13, 2024):

I will have a look at our database then. Strange thing is that most search queries give a good response where other queries are slow.

@richardbeumer commented on GitHub (May 13, 2024): I will have a look at our database then. Strange thing is that most search queries give a good response where other queries are slow.
Author
Owner

@lunny commented on GitHub (May 14, 2024):

What type database are you using with Gitea?

@lunny commented on GitHub (May 14, 2024): What type database are you using with Gitea?
Author
Owner

@richardbeumer commented on GitHub (May 14, 2024):

We are running on Postgres.

@richardbeumer commented on GitHub (May 14, 2024): We are running on Postgres.
Author
Owner

@alvonwong commented on GitHub (Jun 10, 2024):

I have the same problem . 1.21.5 works fine on FreeBSD14.1release/amd64/postgresql15,but 1.21.6 shows slow router and can't edit with sqlite or postgresql .
FYI, v1.21.11 and v1.22.0 work fine on FreeBSD14.1release/amd64/postgresql15 .

@alvonwong commented on GitHub (Jun 10, 2024): I have the same problem . 1.21.5 works fine on FreeBSD14.1release/amd64/postgresql15,but 1.21.6 shows slow router and can't edit with sqlite or postgresql . FYI, v1.21.11 and v1.22.0 work fine on FreeBSD14.1release/amd64/postgresql15 .
Author
Owner

@somera commented on GitHub (Aug 1, 2024):

I run Gitea 1.22.1 with PostgreSQL 16 on NUC with 4 Cores and Ubuntu 22.04.x server. And I have ~22000 projects and the search ist fast. The question is how is your database configured. How much memory, work_mem, ... All this has an impact on the speed. And when you see the wuery in postgresql.log or gitea.log, than just try explain analyse sql in an db client to see what happens.

@somera commented on GitHub (Aug 1, 2024): I run Gitea 1.22.1 with PostgreSQL 16 on NUC with 4 Cores and Ubuntu 22.04.x server. And I have ~22000 projects and the search ist fast. The question is how is your database configured. How much memory, work_mem, ... All this has an impact on the speed. And when you see the wuery in postgresql.log or gitea.log, than just try explain analyse sql in an db client to see what happens.
Author
Owner

@richardbeumer commented on GitHub (Jun 23, 2025):

Issue was solved after updating to 1.22

@richardbeumer commented on GitHub (Jun 23, 2025): Issue was solved after updating to 1.22
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12900