Skip to content

Excessive queries to system_setting table causing slow load times #22281

Closed
@kimma

Description

@kimma

Description

Dashboard/home screen takes around 3-4 seconds to load.
Have turned on SQL logging, and it seems to be repeating two queries related to Avatars/System Settings for almost the full duration of the request, and then finally serving the page.

Seems related to this new feature listed for 1.18.0
Add system setting table with cache and also add cache supports for user setting (https://github.com/go-gitea/gitea/pull/18058)

It seems no Cache is utilized, since the query is repeated several times for each include of the avatar on the Dashboard/Home page.
Disabling Gravatar support does not affect load times, it simply does not load the Gravatar avatar but still queries the setting multiple times.

The attached log gist is an excerpt from the SQL logs showing all queries ran from hitting "refresh" on the Dashboard page and until NginX returns the result.

Gitea Version

1.18.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/kimma/0ce826ed7f68353c4a22cf422d50cd4c

Screenshots

Footer with load times:
Screenshot 2022-12-30 at 11 47 38

The dashboard in question:
Screenshot 2022-12-30 at 12 32 57

Git Version

No response

Operating System

Kubernetes

How are you running Gitea?

Utilizing the Docker image from docker hub: gitea/gitea:1.18.0
Running in Kubernetes with Galera (mariadb) backend, Redis cache and Minio storage

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions