Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harbor launches slowly when registry has too many repositories #1052

Closed
kdada opened this issue Nov 10, 2016 · 2 comments
Closed

Harbor launches slowly when registry has too many repositories #1052

kdada opened this issue Nov 10, 2016 · 2 comments
Assignees

Comments

@kdada
Copy link
Contributor

kdada commented Nov 10, 2016

Version:

  • docker 1.12.0
  • docker-compose 1.8.1
  • harbor 0.4.0

Registry use aliyun OSS as storage backend. There are 12000+ repositories in registry.

harbor/ui log:

Nov 10 11:56:50 192.168.16.1 ui[727]: 2016-11-10T03:56:50Z [DEBUG] [utils.go:246]: Start syncing repositories from registry to DB... 
Nov 10 11:56:50 192.168.16.1 ui[727]: 2016-11-10T03:56:50Z [DEBUG] [authutils.go:67]: scopes: [registry:catalog:*]
Nov 10 11:56:50 192.168.16.1 ui[727]: 2016-11-10T03:56:50Z [INFO] current access, type: registry, name:catalog, actions:[*] 
Nov 10 12:18:29 192.168.16.1 ui[727]: 2016-11-10T04:18:29Z [DEBUG] [transport.go:51]: 200 | GET http://registry:5000/v2/_catalog?n=200000
Nov 10 12:18:29 192.168.16.1 ui[727]: 2016-11-10T04:18:29Z [DEBUG] [utils.go:249]: reposInRegistry count:12008
Nov 10 12:18:29 192.168.16.1 ui[727]: 2016-11-10T04:18:29Z [DEBUG] [utils.go:266]: reposInDB count:0
Nov 10 12:18:35 192.168.16.1 ui[727]: 2016-11-10T04:18:35Z [DEBUG] [utils.go:271]: reposToAdd count:0
Nov 10 12:18:35 192.168.16.1 ui[727]: 2016-11-10T04:18:35Z [DEBUG] [utils.go:272]: reposToDel count:0
Nov 10 12:18:35 192.168.16.1 ui[727]: 2016-11-10T04:18:35Z [DEBUG] [utils.go:311]: Sync repositories from registry to DB is done.

It takes about 20 minutes to sync repositories from registry to DB.

@kdada kdada changed the title Harbor launchs slowly when registry has too many repositories Harbor launches slowly when registry has too many repositories Nov 10, 2016
@reasonerjt
Copy link
Contributor

I see the time was spent here:
Nov 10 11:56:50 192.168.16.1 ui[727]: 2016-11-10T03:56:50Z [INFO] current access, type: registry, name:catalog, actions:[*]
Nov 10 12:18:29 192.168.16.1 ui[727]: 2016-11-10T04:18:29Z [DEBUG] [transport.go:51]: 200 | GET http://registry:5000/v2/_catalog?n=200000

The intention is to avoid inconsistency between DB and registry data.
We can add a flag to skip the sync so it won't try to call the API v2/_catalog to sync image to DB. However due to internal release schedule the change can't be made shortly.
To workaround, you can comment the line 83~85 in src/ui/main.go to skip this step.

Sorry for the inconvenience

@reasonerjt
Copy link
Contributor

Closing as we disabled syncing registry by default now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants