boot项目可采用undertow 进行多线程配置
例如:
server.undertow.io-threads=3
server.undertow.worker-threads=64
1.pom依赖
<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>
2.默认配置
undertow默认最少会初始化24个线程,最多60个线程。
可查看源码,看默认值
线程池大小,影响生产性能,请求是否能够及时响应