SpringBoot中如果使用内嵌Tomcat,那么内嵌Tomcat的默认配置在ServerProperties(org.springframework.boot.autoconfigure.web)中,具体内容如下:
/**
* Tomcat properties.
*/
public static class Tomcat {/**
* Maximum amount of worker threads.最大的工作线程数,默认为200,只能最多有200个耗时(比如查数据库)操作同时进行,一般小型应用中,达不到200个并发耗时操作。
*/
private int maxThreads = 200;
/**
* Minimum amount of worker threads.最小工作线程数,默认为10,即初始化时会创建10个线程用于处理请求。
*/
private int minSpareThreads = 10;/**
* Maximum number of connections that the server accepts and processes at any
* given time. Once the limit has been reached, the operating system may still
* accept connections based on the "acceptCount" property.Tomcat在给定时间(同一时间)能接受的最大连接数。
*/
private int maxConnections = 10000;
/**
* Maximum queue length for incoming connection requests when all possible request
* processing threads are in use.当前连接数超过maxConnections时,还能接受的连接的数量(排队的数量)。
*/
private int acceptCount = 100;
}