優(yōu)化spring boot
Undertow是Wildfly的web服務器,性能不必多說,在嵌入微服務方面比tomcat更小。
gradle環(huán)境
configurations {
compile.exclude module: 'spring-boot-starter-tomcat'
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-undertow')
// ...
}
maven環(huán)境
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
我一臺主機要放多個應用,為了節(jié)省機器內存,所以選擇更節(jié)省內存的容器,