# Very slow to load pages

**URL:** <https://forum.gitea.com/t/very-slow-to-load-pages/8495>\
**Category:** Install/Maintain/Configure\
**Created:** [January 28, 2024, 11:48pm UTC](https://forum.gitea.com/t/very-slow-to-load-pages/8495 "2024-01-28T23:48:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hmoffatt](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@hmoffatt](https://forum.gitea.com/u/hmoffatt)\
**Post date:** [January 28, 2024, 11:48pm UTC](https://forum.gitea.com/t/very-slow-to-load-pages/8495/1 "2024-01-28T23:48:34Z")

</div>

I’m just getting started with Gitea, and I’m finding many pages are quite slow to load eg working in the site administration area. Loading the configuration page (site admin → configuration) can take 10 seconds or more, sometimes the dashboard can take that long also but some times it’s instant.

I’m running Debian bullseye, using the .deb package, with Apache HTTPD as a reverse proxy/TLS frontend. I have lots of other services behind the reverse proxy which run fine. The CPU load is 1 on average, and doesn’t change much when I’m waiting on Gitea. The database is Postgres 13 and I’m also using OpenID Connect to login.

Going to the config page generates the following log lines:

```auto
...eb/routing/logger.go:102:func1() [I] router: completed GET /admin for <IP>:0, 200 OK in 11.3ms @ admin/admin.go:127(admin.Dashboard)
...eb/routing/logger.go:68:func1() [I] router: polling GET /user/events for <IP>:0, elapsed 3289.1ms @ events/events.go:18(events.Events)
...eb/routing/logger.go:102:func1() [I] router: completed GET /user/events for <IP>:0, 200 OK in 90005.7ms @ events/events.go:18(events.Events)
...eb/routing/logger.go:102:func1() [I] router: completed GET /admin/config for <IP>:0, 200 OK in 11.5ms @ admin/config.go:100(admin.Config)
...eb/routing/logger.go:102:func1() [I] router: completed GET /user/events for <IP>:0, 200 OK in 30007.3ms @ events/events.go:18(events.Events)
...eb/routing/logger.go:68:func1() [I] router: polling GET /user/events for <IP>:0, elapsed 3854.0ms @ events/events.go:18(events.Events)

```

I turned off Gravatar and federated avatars as per the FAQ and it didn’t help.

Can anyone suggest something I need to fix or how to get more information?

Thanks

---

<div class="post-metadata">

**Author:** ![delvh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/delvh/32/5047_2.png) [@delvh](https://forum.gitea.com/u/delvh)\
**Post date:** [January 28, 2024, 11:56pm UTC](https://forum.gitea.com/t/very-slow-to-load-pages/8495/2 "2024-01-28T23:56:54Z")

</div>

The logs are strange here:  
The only requests related to that are

```sh
...eb/routing/logger.go:102:func1() [I] router: completed GET /admin for <IP>:0, 200 OK in 11.3ms @ admin/admin.go:127(admin.Dashboard)
...eb/routing/logger.go:102:func1() [I] router: completed GET /admin/config for <IP>:0, 200 OK in 11.5ms @ admin/config.go:100(admin.Config)

```

but they are finished in milliseconds (11.3ms, 11.5ms).  
Sounds like your reverse proxy makes problems as Gitea isn’t that slow according to the logs…

---

<div class="post-metadata">

**Author:** ![hmoffatt](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@hmoffatt](https://forum.gitea.com/u/hmoffatt)\
**Post date:** [January 29, 2024, 12:27am UTC](https://forum.gitea.com/t/very-slow-to-load-pages/8495/3 "2024-01-29T00:27:38Z")

</div>

Is it normal for the /user/events fetches to be 30 or 90 seconds?

```auto
...eb/routing/logger.go:68:func1() [I] router: polling GET /user/events for <IP>:0, elapsed 3289.1ms @ events/events.go:18(events.Events)
...eb/routing/logger.go:102:func1() [I] router: completed GET /user/events for <IP>:0, 200 OK in 90005.7ms @ events/events.go:18(events.Events)

```

---

<div class="post-metadata">

**Author:** ![delvh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/delvh/32/5047_2.png) [@delvh](https://forum.gitea.com/u/delvh)\
**Post date:** [January 29, 2024, 12:28am UTC](https://forum.gitea.com/t/very-slow-to-load-pages/8495/4 "2024-01-29T00:28:55Z")

</div>

Yes, they are completely unrelated and intended to be long running

---

<div class="post-metadata">

**Author:** ![hmoffatt](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@hmoffatt](https://forum.gitea.com/u/hmoffatt)\
**Post date:** [January 29, 2024, 3:49am UTC](https://forum.gitea.com/t/very-slow-to-load-pages/8495/5 "2024-01-29T03:49:36Z")

</div>

If I reload the /admin/config page repeatedly, it is very slow every 3-4 times, fast the others. When it’s slow, I see the following in the Apache reverse proxy log

```auto
[Mon Jan 29 12:51:59.459216 2024] [proxy:debug] [pid 378150:tid 140007078917888] proxy_util.c(2554): AH00943: http: has released connection for (localhost:3000)

```

It looks like Apache is stuck waiting for more data from Gitea. I set a timeout of 1 second (maybe it’s too short) and now it’s working.

This seems to be this issue: [Slow browsing on http2 enabled reverse proxy, long-polling `/user/events` blocks other requests · Issue #19265 · go-gitea/gitea · GitHub](https://github.com/go-gitea/gitea/issues/19265)

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [January 29, 2024, 5:42am UTC](https://forum.gitea.com/t/very-slow-to-load-pages/8495/6 "2024-01-29T05:42:19Z")

</div>

Can you reproduce it when visiting Gitea directly?

---

<div class="post-metadata">

**Author:** ![hmoffatt](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@hmoffatt](https://forum.gitea.com/u/hmoffatt)\
**Post date:** [January 29, 2024, 5:53am UTC](https://forum.gitea.com/t/very-slow-to-load-pages/8495/7 "2024-01-29T05:53:09Z")

</div>

It works when I visit directly, and it works with the workaround in that Github issue (ie disable HTTP/2 for that site in Apache).

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [January 30, 2024, 2:35am UTC](https://forum.gitea.com/t/very-slow-to-load-pages/8495/8 "2024-01-30T02:35:15Z")

</div>

Glad to hear you resolved the problem.
