zoukankan      html  css  js  c++  java
  • SpringBoot-将servlet容器变成undertow测试tomcat吞吐量

    将Servlet容器变成Undertow

    默认情况下,Spring Boot 使用 Tomcat 来作为内嵌的 Servlet 容器

    可以将 Web 服务器切换到 Undertow 来提高应用性能。Undertow 是一个采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。Undertow 是红帽公司的开源产品,是 Wildfly 默认的 Web 服务器。首先,从依赖信息里移除 Tomcat 配置:

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

    然后添加 Undertow:

    <dependency>

          <groupId>org.springframework.boot</groupId>

          <artifactId>spring-boot-starter-undertow</artifactId>

    </dependency>

      

    服务器名称

    第一次运行

    第二次运行

    第三次运行

    平均值

    Tomcat

    4773

    5194

    5334.7

    5100

    Undertow

    6666

    6373

    6451

    6496

  • 相关阅读:
    CF 441E Valera and Number
    CodeForces 1111E. Tree
    CodeForces 1098F. Ж-function
    CodeForces 1098E. Fedya the Potter
    CodeForces 1098D. Eels
    CodeForces 1103E. Radix sum
    CodeForces 1103D. Professional layer
    CodeForces 1103C. Johnny Solving
    CodeForces 1107F. Vasya and Endless Credits
    Hackerrank: Week of Code 36
  • 原文地址:https://www.cnblogs.com/XJJD/p/10399940.html
Copyright © 2011-2022 走看看