购物app首页ui设计,淘宝优化,游戏直播网站怎么做的,软件工程师培训机构排名一、Tomcat配置
1. 通过application.yml配置 以下展示常用配置
server:port: 8182 # 配置端口tomcat:threads:max: 10 # 最大工作线程#xff0c;默认是200min-spare: 5 # 最小工作线程#xff0c;默认是10accept-count: 200 # tomcat启动线程达到最大值后#xff0c;接受…一、Tomcat配置
1. 通过application.yml配置 以下展示常用配置
server:port: 8182 # 配置端口tomcat:threads:max: 10 # 最大工作线程默认是200min-spare: 5 # 最小工作线程默认是10accept-count: 200 # tomcat启动线程达到最大值后接受的排队请求个数默认是100max-connections: 2000 # 最大连接数并发数默认是8192connection-timeout: 10000 # 建立连接的超时时间单位是毫秒2. 通过类配置
Component
public class CostumizationBean implements WebServerFactoryCustomizerConfigurableServletWebServerFactory {Overridepublic void customize(ConfigurableServletWebServerFactory servlet) {servlet.setPort(10000); // 设置端口为10000// 还可以进行多种配置}
}注意使用配置文件可配置的更全
二、Tomcat切换Undertow 将Tomcat切换为Undertow主要有以下几个步骤
修改pom.xml删除Tomcat
dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId!--删除 tomcat --exclusionsexclusiongroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-tomcat/artifactId/exclusion/exclusions
/dependency加入undertow
dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-undertow/artifactId
/dependency