Reputation: 1
When i start my Spring Boot Application on Windows10 (within IDE), i can type the url in Chrome and get what i want immediatly.
However, when i start it on a ubuntu server, it will be 10 minutes or even half an hour until it works. I see no need for this and want to cut it.
(But when i start it, i can see "Started Application in 18.193 seconds (JVM running for 19.086)")
Of course, after serveral minutes, it works quite well.
The version is spring boot 1.4.2.
Is there any reasons for this?
Thanks a lot!
Upvotes: 0
Views: 629
Reputation: 29150
Component Scanning Slows Start-up
Auto-Configuration Can Load More Than You Need
The @SpringBootApplication
annotation implies the @EnableAutoConfiguration
annotation. This enables auto-configuration. This can load components you don't need, slowing application start-up and increasing memory and CPU usage.
Resource Link: Spring Boot Performance
You can enable DEBUG logging as simple as specifying --debug
when starting the application from command line. You can also specify debug=true
in your application.properties
.
In addition, you can set the logging level in application.properties
as given below:
logging.level.org.springframework.web: DEBUG
logging.level.org.hibernate: ERROR
If you detect an auto-configured module you don't want, it can be disabled. The docs for this can be found here: http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-disabling-specific-auto-configuration
Resource Link: https://stackoverflow.com/a/35713866/2293534
Upvotes: 2