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

  • 相关阅读:
    博客园精华集汇总
    SQLServer中临时表与表变量的区别分析
    【转】InstantClient安装使用
    博客人生
    【Sniffer】如何查看Sniffer截获的数据内容
    Excel使用基础
    书和耳机到了
    MindManager Pro 9.1.157更改默认字体
    xml spy中显示文件路径
    【LR】Error 27191: "web_image_check" failed 报错解决方法
  • 原文地址:https://www.cnblogs.com/XJJD/p/10399940.html
Copyright © 2011-2022 走看看