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

Slow "Looking for the newly published extensions in registry.quarkus.io"? #30531

Closed
maxandersen opened this issue Jan 23, 2023 · 19 comments
Closed
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/jbang Issues related to when using jbang.dev with Quarkus area/maven area/user-experience Will make us lose users kind/bug Something isn't working

Comments

@maxandersen
Copy link
Member

Describe the bug

quarkus create app was fairly quick in the past (a few seconds on a fresh install) but over time it has grown super slow and I'm now seeing it taking close to 50 seconds.

quarkus create app xxx 8,85s user 1,17s system 21% cpu 47,297 total

Second one is ~6 seconds of which some seconds are taken by me using remote quarkus via jbang.

Thus its most likely the check of caching that is eating up the time.

Opening this issue to collect info - @aloubyansky any particular debug options you want me to run with? :)

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@maxandersen maxandersen added kind/bug Something isn't working area/maven area/cli Related to quarkus cli (not maven/gradle/etc.) labels Jan 23, 2023
@quarkus-bot quarkus-bot bot added the area/jbang Issues related to when using jbang.dev with Quarkus label Jan 23, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 23, 2023

/cc @quarkusio/devtools (jbang)

@aloubyansky
Copy link
Member

We've discussed it before, the reasons are:

  • our registry appears to be slower than Central no matter what we did so far
  • the number of streams/versions we recommend has increased from 2/3 to 4 (recently it was 5).

@aloubyansky
Copy link
Member

This is what I considered for the CLI quarkusio/registry.quarkus.io#135

@maxandersen
Copy link
Member Author

thanks - still curious to know where it is spent. is it the raw download or the processing of the streams that causing it?

registry profile can help but still feels like a bandaid assuming the number of extensions will grow too.

@aloubyansky
Copy link
Member

Primarily, it's the number of remote requests to the registry. The wider the range of Quarkus versions we "recommend" for project creation, the more requests we'll be sending to the registry to update extension catalogs for each Quarkus version locally.
While we should consider other optimizations, introducing client profiles would be easier today, I think.

@maxandersen
Copy link
Member Author

so we are doing multiple requests even for the recommended bunch? would it help to get it in all in one batch?

Also, I'm still feeling like the issue we have is that we are mixing up list of versions that are recommended with list of versions to show in the default list like, at the moment for create app only 2.13 and 2.16 seems relevant to push. 3.x and any new or older are purely for specific version usecases.

The client based profile indirectly makes this happen - but its slightly different for IDE's. It would want to be able to show the list of recent relevant versions; but still not require to download all combinations.

I gues what I'm saying is that the client based profile notion solves the issue but does it even need to be a "client profile " wouldn't it just work by having actual recommend list separate from recent/relevant versions to show?

i.e. recommended would be 2.13 and 2.16 and the recent/relevant list is 2.7,2.13,2.16,3.0alpha? and then client can pre-fetch whatever set they are after?

@ia3andy
Copy link
Contributor

ia3andy commented Jan 23, 2023

@aloubyansky wouldn't that be possible to:

  • load a subset of the data which would be needed immediately
  • load more specific data only when needed

@gastaldi gastaldi changed the title Slow "Looking for the newly published extensions in reigstry.quarkus.io"? Slow "Looking for the newly published extensions in registry.quarkus.io"? Jan 23, 2023
@gastaldi
Copy link
Contributor

gastaldi commented Jan 23, 2023

We should also improve that message, as it appears that a single request is taking that long to complete, which is not true

@aloubyansky
Copy link
Member

--verbose will log more details

@aloubyansky
Copy link
Member

Enabling debug will result in

[aloubyansky@localhost playground]$ quarkus create --refresh
Creating an app (default project type, see --help).
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-registry-descriptor/1.0-SNAPSHOT/maven-metadata.xml
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-registry-descriptor/1.0-SNAPSHOT/maven-metadata.xml (19 kB at 22 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-registry-descriptor/1.0-SNAPSHOT/quarkus-registry-descriptor-1.0-20230123.120938-1.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-registry-descriptor/1.0-SNAPSHOT/quarkus-registry-descriptor-1.0-20230123.120938-1.json (470 B at 1.1 kB/s)
Looking for the newly published extensions in registry.quarkus.io
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-platforms/1.0-SNAPSHOT/maven-metadata.xml
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-platforms/1.0-SNAPSHOT/maven-metadata.xml (19 kB at 90 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-platforms/1.0-SNAPSHOT/quarkus-platforms-1.0-20230123.120938-1.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-platforms/1.0-SNAPSHOT/quarkus-platforms-1.0-20230123.120938-1.json (3.3 kB at 58 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/maven-metadata.xml
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/maven-metadata.xml (19 kB at 92 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.15.3.Final.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.15.3.Final.json (83 kB at 1.1 MB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.13.7.Final.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.13.7.Final.json (77 kB at 15 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.16.0.CR1.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.16.0.CR1.json (83 kB at 546 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-3.0.0.Alpha3.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-3.0.0.Alpha3.json (5.5 kB at 34 kB/s)
-----------

@aloubyansky
Copy link
Member

We didn't really need to be more verbose before, one line was kind of enough to indicate it's not hanging. Now it's more like it is hanging.

@aloubyansky
Copy link
Member

Notice the speed difference:

Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-platforms/1.0-SNAPSHOT/maven-metadata.xml
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-platforms/1.0-SNAPSHOT/maven-metadata.xml (19 kB at 41 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-platforms/1.0-SNAPSHOT/quarkus-platforms-1.0-20230123.120938-1.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-platforms/1.0-SNAPSHOT/quarkus-platforms-1.0-20230123.120938-1.json (3.3 kB at 8.1 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/maven-metadata.xml
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/maven-metadata.xml (19 kB at 49 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.15.3.Final.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.15.3.Final.json (83 kB at 9.8 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.13.7.Final.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.13.7.Final.json (77 kB at 8.6 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.16.0.CR1.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-2.16.0.CR1.json (83 kB at 9.9 kB/s)
Downloading from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-3.0.0.Alpha3.json
Downloaded from registry.quarkus.io: https://registry.quarkus.io/maven/io/quarkus/registry/quarkus-non-platform-extensions/1.0-SNAPSHOT/quarkus-non-platform-extensions-1.0-20230123.120938-1-3.0.0.Alpha3.json (5.5 kB at 448 B/s)

@aloubyansky
Copy link
Member

5.5 kB at 448 B/s

@aloubyansky
Copy link
Member

@aloubyansky wouldn't that be possible to:

  • load a subset of the data which would be needed immediately
  • load more specific data only when needed

Not always. If we take RHBQ, we need data for all the currently supported streams (which typically would be two). We can't simply look up extensions in the latest release and fallback to upstream. We may need to prioritize the previous product release before falling back to upstream because some products are available in the previous productized platform and we should recommend those versions instead of the latest upstream.

@aloubyansky
Copy link
Member

@maxandersen the idea behind client profiles is exactly that. We could flip it and say by default it would be like before - two latest streams. And allow code.quarkus to ask for more. The use-case is the same - providing a range of Quarkus versions currently recommended for new projects.

We could consider sending catalogs in a single artifact. Then we'll have to split on the client side or process it otherwise so that we keep an up-to-date version of a catalog per Quarkus version on the client side. There could be existing projects based on different Quarkus versions, so the tools would need to be able to know from where to load that data. Currently it's split by Quarkus version and parsing those artifacts isn't really affecting UX. Once everything's cached it's fast enough.

@ebullient
Copy link
Member

ebullient commented Jan 23, 2023

Can/should more of this data be CDN cached?

Output a message before fetching and after fetching to let humans know what the expensive operation is.

Default to using a cache: if the cache is present, we can just do things. (message before/after downloading cache/catalog when it isn't there). Warn at the end of the operation that updates are available (check in the background for stale cache data).

Provide an explicit command to "pull" the new cache (could go along w/ update or whatever)

@gsmet
Copy link
Member

gsmet commented Jan 23, 2023

Not saying that we shouldn't cache things but I'm working on optimizing the SQL query that I think is the cause of the main issue.

I have something nearly ready but I need to wrap it and push it to the Java code.

@gastaldi gastaldi added the area/user-experience Will make us lose users label Jan 24, 2023
@gsmet
Copy link
Member

gsmet commented Jan 24, 2023

Things should be significantly better with quarkusio/registry.quarkus.io#167 in.

I let @gastaldi take his time to review it. There's no emergency given it has been like that for weeks now.

@gsmet
Copy link
Member

gsmet commented Jan 24, 2023

I think we are good enough now.

@gsmet gsmet closed this as completed Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) area/jbang Issues related to when using jbang.dev with Quarkus area/maven area/user-experience Will make us lose users kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants