SpringBoot 替换默认的Tomcat


<dependency>

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

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

<!-- 从依赖信息里移除 Tomcat配置 -->

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


```

配置参数

io-threads = CPU核心数量 * 2

worker-threads= io-threads * 8

``` yml

server:
undertow:
io-threads: 4
worker-threads: 32