-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
Description
Slow performance (7 minutes) on UI/API when adding/removing team in large organization (2000+ repos)
Steps to reproduce
- Create organization with 2000+ repos
- Create new team with:
- Repository access = All repos
- Permission = General access
- Access to sections = all to Read
- External Wiki/Issues = disabled
- Add new user to this team
- Wait 30-35 seconds until it done
Gitea Version
1.16.3
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.21.0
Operating System
CentOS Linux 7 (Core)
How are you running Gitea?
APP_NAME = -ERASED-
RUN_USER = git
RUN_MODE = prod
[security]
INTERNAL_TOKEN = -ERASED-
INSTALL_LOCK = true
SECRET_KEY = -ERASED-
PASSWORD_HASH_ALGO = pbkdf2
DISABLE_GIT_HOOKS = false
[database]
DB_TYPE = postgres
HOST = -ERASED-
NAME = -ERASED-
USER = -ERASED-
PASSWD = -ERASED-
SCHEMA =
SSL_MODE = disable
CHARSET = utf8
PATH = /var/lib/gitea/data/gitea.db
LOG_SQL = false
[repository]
ROOT = /var/lib/gitea/data/gitea-repositories
[server]
SSH_DOMAIN = -ERASED-
DOMAIN = -ERASED-
HTTP_PORT = 3000
ROOT_URL = -ERASED-
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = true
LFS_JWT_SECRET = -ERASED-
OFFLINE_MODE = false
[lfs]
PATH = /var/lib/gitea/data/lfs
[mailer]
ENABLED = true
HOST = -ERASED-
FROM = -ERASED-
USER =
PASSWD =
[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = true
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = false
REQUIRE_SIGNIN_VIEW = true
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = false
ENABLE_TIMETRACKING = false
DEFAULT_ENABLE_TIMETRACKING = false
NO_REPLY_ADDRESS = noreply.localhost
[picture]
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = true
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false
[session]
PROVIDER = file
[log]
MODE = file,console
LEVEL = info
ROOT_PATH = /var/lib/gitea/log
ROUTER = console,file
[metrics]
ENABLED = true
[mirror]
MIN_INTERVAL = 1m
[indexer]
ISSUE_INDEXER_TYPE = elasticsearch
ISSUE_INDEXER_CONN_STR = http://-ERASED-
ISSUE_INDEXER_NAME = gitea_issues
ISSUE_INDEXER_PATH = indexers/issues.bleve
REPO_INDEXER_ENABLED = true
REPO_INDEXER_TYPE = elasticsearch
REPO_INDEXER_CONN_STR = http://-ERASED-
REPO_INDEXER_NAME = gitea_codes
REPO_INDEXER_PATH = indexers/repos.bleve
UPDATE_BUFFER_LEN = 20
MAX_FILE_SIZE = 1048576
REPO_INDEXER_INCLUDE =
REPO_INDEXER_EXCLUDE = resources/bin/**
STARTUP_TIMEOUT = 30s
[git.timeout]
MIGRATE = 1800
MIRROR = 600
Database
PostgreSQL
Activity
lunny commentedon Mar 26, 2022
Could you provide logs?
mscherer commentedon Mar 26, 2022
Given the code, I would say that's likely something on https://github.com/go-gitea/gitea/blob/e69b7a92ed/models/org_team.go#L969 . The more repos on a team, the more slow it would be due to the looping over all repos.
IT-AlexKor commentedon Mar 27, 2022
Here the part of Logs:
6543 commentedon Mar 29, 2022
@IT-AlexKor can you test latest state of #19227 ?
IT-AlexKor commentedon Mar 29, 2022
@6543 sorry, but it may be complicated, because it's a single production instance...
lunny commentedon Mar 29, 2022
I have tested locally. Add member should be very fast, but I need to know if the result is right. Have no idea to optimize remove member from team.