quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

Quarkus starts slowly #20922

Closed siwee closed 3 years ago

siwee commented 3 years ago

Describe the bug

Usually quarkus starts very quickly, but after I upgraded the version to 2.3.0.Final, the startup became very slow.

log output:

2021-10-21 14:34:53,920 WARN  [org.tes.uti.TestcontainersConfiguration] (build-42) Attempted to read Testcontainers configuration file at file:/C:/Users/lygoi/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: C:\Users\lygoi\.testcontainers.properties (?????????????????)
2021-10-21 14:34:53,957 INFO  [org.tes.doc.DockerMachineClientProviderStrategy] (build-42) docker-machine executable was not found on PATH ([C:\Program Files (x86)\VMware\VMware Workstation\bin\, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0\, C:\Windows\System32\OpenSSH\, D:\SDK\Windows\graalvm-ce-java17-21.3.0\bin, V:\Maven\apache-maven-latest\bin, C:\Program Files\TortoiseSVN\bin, D:\Documents\OneDrive\APPS\Kitty, E:\Soft\jaxb\jaxb-ri\bin, C:\Program Files\Git\cmd, D:\Documents\OneDrive\APPS\Android\platform-tools_r29-windows, C:\Program Files\TortoiseGit\bin, C:\Program Files\dotnet\, C:\Program Files\nodejs\, C:\Program Files (x86)\NetSarang\Xshell 7\, C:\Program Files (x86)\NetSarang\Xftp 7\, D:\gnuplot\bin, C:\Users\lygoi\AppData\Local\Programs\Python\Python39\Scripts\, C:\Users\lygoi\AppData\Local\Programs\Python\Python39\, C:\Users\lygoi\.cargo\bin, C:\Users\lygoi\AppData\Local\Microsoft\WindowsApps, C:\Program Files\Microsoft VS Code\bin, C:\Users\lygoi\.dotnet\tools, C:\Program Files\Fiddler, C:\Users\lygoi\.dotnet\tools, C:\Users\lygoi\AppData\Roaming\npm])
2021-10-21 14:35:24,139 ERROR [org.tes.doc.DockerClientProviderStrategy] (build-42) Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
2021-10-21 14:35:24,139 ERROR [org.tes.doc.DockerClientProviderStrategy] (build-42)     NpipeSocketClientProviderStrategy: failed with exception TimeoutException (org.rnorth.ducttape.TimeoutException: java.util.concurrent.TimeoutException). Root cause TimeoutException (null)
2021-10-21 14:35:24,139 ERROR [org.tes.doc.DockerClientProviderStrategy] (build-42) As no valid configuration was found, execution cannot continue
2021-10-21 14:35:24,142 WARN  [io.qua.dep.IsDockerWorking] (build-42) No Docker binary found or general error: java.lang.RuntimeException: Input/Output error while executing command.
2021-10-21 14:35:24,143 WARN  [io.qua.red.cli.dep.DevServicesRedisProcessor] (build-42) Please configure quarkus.redis.hosts for default redis client or get a working docker instance
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2021-10-21 14:35:25,288 INFO  [io.quarkus] (Quarkus Main Thread) provider-hkexpress 1.0-SNAPSHOT on JVM (powered by Quarkus 2.3.0.Final) started in 32.356s. Listening on: http://localhost:8080
2021-10-21 14:35:25,291 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-10-21 14:35:25,291 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, quarkus-navitaire, reactive-routes, redis-client, resteasy, smallrye-context-propagation, vertx, vertx-web-client]

Expected behavior

Quick start.

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

Windows 10 20H1

Output of java -version

17

GraalVM version (if different from Java)

21.3.0

Quarkus version or git rev

2.3.0.Final

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

3.8.1

Additional information

No response

siwee commented 3 years ago

Properties:

quarkus.console.color=true
siwee commented 3 years ago

The problem seems to be caused by the redis extension component. After I removed the redis extension dependency, it was fine.

geoand commented 3 years ago

If you start the application with -Dquarkus.debug.print-startup-times=true you can confirm your observation.

cc @machi1990

machi1990 commented 3 years ago

If you start the application with -Dquarkus.debug.print-startup-times=true you can confirm your observation.

cc @machi1990

By looking at the logs

2021-10-21 14:34:53,920 WARN  [org.tes.uti.TestcontainersConfiguration] (build-42) Attempted to read Testcontainers configuration file at file:/C:/Users/lygoi/.testcontainers.properties but the file was not found. Exception message: FileNotFoundException: C:\Users\lygoi\.testcontainers.properties (?????????????????)
2021-10-21 14:34:53,957 INFO  [org.tes.doc.DockerMachineClientProviderStrategy] (build-42) docker-machine executable was not found on PATH ([C:\Program Files (x86)\VMware\VMware Workstation\bin\, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0\, C:\Windows\System32\OpenSSH\, D:\SDK\Windows\graalvm-ce-java17-21.3.0\bin, V:\Maven\apache-maven-latest\bin, C:\Program Files\TortoiseSVN\bin, D:\Documents\OneDrive\APPS\Kitty, E:\Soft\jaxb\jaxb-ri\bin, C:\Program Files\Git\cmd, D:\Documents\OneDrive\APPS\Android\platform-tools_r29-windows, C:\Program Files\TortoiseGit\bin, C:\Program Files\dotnet\, C:\Program Files\nodejs\, C:\Program Files (x86)\NetSarang\Xshell 7\, C:\Program Files (x86)\NetSarang\Xftp 7\, D:\gnuplot\bin, C:\Users\lygoi\AppData\Local\Programs\Python\Python39\Scripts\, C:\Users\lygoi\AppData\Local\Programs\Python\Python39\, C:\Users\lygoi\.cargo\bin, C:\Users\lygoi\AppData\Local\Microsoft\WindowsApps, C:\Program Files\Microsoft VS Code\bin, C:\Users\lygoi\.dotnet\tools, C:\Program Files\Fiddler, C:\Users\lygoi\.dotnet\tools, C:\Users\lygoi\AppData\Roaming\npm])
2021-10-21 14:35:24,139 ERROR [org.tes.doc.DockerClientProviderStrategy] (build-42) Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
2021-10-21 14:35:24,139 ERROR [org.tes.doc.DockerClientProviderStrategy] (build-42)     NpipeSocketClientProviderStrategy: failed with exception TimeoutException (org.rnorth.ducttape.TimeoutException: java.util.concurrent.TimeoutException). Root cause TimeoutException (null)
2021-10-21 14:35:24,139 ERROR [org.tes.doc.DockerClientProviderStrategy] (build-42) As no valid configuration was found, execution cannot continue
2021-10-21 14:35:24,142 WARN  [io.qua.dep.IsDockerWorking] (build-42) No Docker binary found or general error: java.lang.RuntimeException: Input/Output error while executing command.
2021-10-21 14:35:24,143 WARN  [io.qua.red.cli.dep.DevServicesRedisProcessor] (build-42) Please configure quarkus.redis.hosts for default redis client or get a working docker instance

A lot of time (about 30 seconds) is spent on launching the redis dev services and it seems like you do not have a docker running. Can you disable redis dev service quarkus.redis.devservices.enabled=false and configure quarkus.redis.hosts in your application properties?

siwee commented 3 years ago

Hi, @machi1990

Thanks for your reply. As you said, I don't run Docker service, usually I don't use Docker. What puzzles me is that sometimes it is good, so it is not easy to reproduce the problem.

siwee commented 3 years ago

When I add the configuration quarkus.redis.devservices.enabled=false, the log outputs a warning.

2021-10-21 15:24:01,643 WARN  [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.redis.devservices.enabled" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
machi1990 commented 3 years ago

When I add the configuration quarkus.redis.devservices.enabled=false, the log outputs a warning.

2021-10-21 15:24:01,643 WARN  [io.qua.config] (Quarkus Main Thread) Unrecognized configuration key "quarkus.redis.devservices.enabled" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo

You said you removed the redis extension, that could be the reason why you are seeing the warning. The suggested configuration only kicks in when redis extension is available.

siwee commented 3 years ago

Ok, quarkus.redis.devservices.enabled=false is working. Thanks @machi1990 @geoand