[Spring Boot]Undertow替换Tomcat

2016-11-22  本文已影响0人  kun1988
优化spring boot

Undertow是Wildfly的web服务器,性能不必多说,在嵌入微服务方面比tomcat更小。
gradle环境

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环境

<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>

我一台主机要放多个应用,为了节省机器内存,所以选择更节省内存的容器,

上一篇 下一篇

猜你喜欢

热点阅读