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

  • 相关阅读:
    java中讲讲PrintStream的用法,举例?
    Spark Scala当中reduceByKey的用法
    springboot与ActiveMQ整合
    solr(六): 集群
    zookeeper集群
    solr(五): centos中, 整合 tomcat&solr
    springboot redis(单机/集群)
    redis 五种数据类型
    redis 集群搭建: redis-cluster
    redis 持久化
  • 原文地址:https://www.cnblogs.com/XJJD/p/10399940.html
Copyright © 2011-2022 走看看