java - Spring Boot - Slow to start application on different connections -
i'm experiencing weirdness spring boot application.
when i'm connected wifi (my home network) or disconnected internet entirely, application starts within 6 seconds.
when i'm connected wifi b (my work network) application takes 1.5 minutes start.
this simple hello, world! spring application. main class looks this:
import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; @springbootapplication public class application { public static void main(string[] args) { system.out.println("start := " + system.currenttimemillis()); springapplication.run(application.class, args); system.out.println("stop := " + system.currenttimemillis()); } }
i see start timestamp printed @ same speed, must springapplication.run. bare class, there no spring configurations otherwise. why change in wifi connection cause such lag start? i'm running both using mvn spring-boot:run
on mac osx
i having similar problem this. simple spring boot app take around 45 seconds start on office network, , under 10 seconds on home network.
it seems there delay identifying external ip address, running following command fixed on mac.
scutil --set hostname "localhost"
Comments
Post a Comment