Tomcat配置文件server.xml中connector的参数minSpareThreads和maxSpareThreads
2020-02-17 05:11
549 查看
在网上看到很多tomcat6.0的优化文章中,都提到了在server.xml中的connector标签中,加上minSpareThreads 和 maxSpareThreads属性,可是我到了tomcat的官网上去看文档,发现tomcat6.0中connector标签根本没有这两个属性,在tomcat5.5中才有。
tomcat5.5的文档连接:http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
里面原文是这样介绍这两个属性的:
maxSpareThreads:The maximum number of unused request processing threads that will be allowed to exist until the thread pool starts stopping the unnecessary threads. The default value is 50.
自己翻译一下,不知道是否正确:
maxSpareThreads:直到线程池开始停止不需要的线程时,允许存在空闲请求处理线程的最大数量。默认值50.
我的理解是这样的,当空闲的线程超过maxSpareThreads时,tomcat就关闭超出这个数值的线程。
网上的说法都是复制粘贴的,如下:
maxSpareThreads:最大备用线程数,一旦创建的线程超过这个值,Tomcat就会关闭不再需要的socket线程。
我觉得和我的理解是不同的。
再说,minSpareThreads。
minSpareThreads:The number of request processing threads that will be created when this Connector is first started. The connector will also make sure it has the specified number of idle processing threads available. This attribute should be set to a value smaller than that set for maxThreads. The default value is 4.
大概意思就是:初始会建立的线程数,并且确保最少会有这么多个线程数可用,并且设定的值要比参数maxThreads大。默认值是4.
以上是tomcat5.5的文档写的内容,到了tomcat6.0,文档里面根本就没有介绍这两个参数,难道是写文档的人落了这两个参数没有写?文档地址如下:
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
可是网上都说tomcat6.0优化要写这两个参数,是为什么???
到了tomcat7.0的时候,只有minSpareThreads了。文档地址如下:
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
tomcat7.0对minSpareThreads的介绍也发生了变化:
minSpareThreads:The minimum number of threads always kept running. If not specified, the default of 10 is used.
大家可以看到,默认值是10个了。
所以大家可否分享一下各自的知识,tomcat6.0究竟是有没有这两个参数呢?
tomcat5.5的文档连接:http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
里面原文是这样介绍这两个属性的:
maxSpareThreads:The maximum number of unused request processing threads that will be allowed to exist until the thread pool starts stopping the unnecessary threads. The default value is 50.
自己翻译一下,不知道是否正确:
maxSpareThreads:直到线程池开始停止不需要的线程时,允许存在空闲请求处理线程的最大数量。默认值50.
我的理解是这样的,当空闲的线程超过maxSpareThreads时,tomcat就关闭超出这个数值的线程。
网上的说法都是复制粘贴的,如下:
maxSpareThreads:最大备用线程数,一旦创建的线程超过这个值,Tomcat就会关闭不再需要的socket线程。
我觉得和我的理解是不同的。
再说,minSpareThreads。
minSpareThreads:The number of request processing threads that will be created when this Connector is first started. The connector will also make sure it has the specified number of idle processing threads available. This attribute should be set to a value smaller than that set for maxThreads. The default value is 4.
大概意思就是:初始会建立的线程数,并且确保最少会有这么多个线程数可用,并且设定的值要比参数maxThreads大。默认值是4.
以上是tomcat5.5的文档写的内容,到了tomcat6.0,文档里面根本就没有介绍这两个参数,难道是写文档的人落了这两个参数没有写?文档地址如下:
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
可是网上都说tomcat6.0优化要写这两个参数,是为什么???
到了tomcat7.0的时候,只有minSpareThreads了。文档地址如下:
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
tomcat7.0对minSpareThreads的介绍也发生了变化:
minSpareThreads:The minimum number of threads always kept running. If not specified, the default of 10 is used.
大家可以看到,默认值是10个了。
所以大家可否分享一下各自的知识,tomcat6.0究竟是有没有这两个参数呢?
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- Linux系统之CentOS安装tomcat
- centos5完美整合Apache+Tomcat,同时支持jsp与php
- TOMCAT8 启动慢
- tomcat服务器安装步骤
- jenkins+tomcat自动化部署映射路径问题
- 浅析Tomcat 服务器下4个xml配置文件
- linux配 4000 置jdk,tomcat,maven,SVN(服务端),SVN(客户端)
- Tomcat提高并发
- Tomcat部署配置文件
- tomcat常用技巧
- Tomcat源码导入Eclipse
- Tomcat下使用Log4j 接管 catalina.out 日志文件生成方式,按天存放
- 解决报错java.lang.UnsatisfiedLinkError: F:\J2EE\apache-tomcat-8.5.46\bin\tcnative-1.dll:Can't load AMD 6...
- linux下tomcat+mysql+jdk+eclipse+myeclipse6.0配置
- Myeclipse 2017 安装+集成配置【JRE 8+Tomcat 9+MySQL 5.7.29】
- 随笔一:阿里云centos7.x下tomcat启动正常但8080端口无法访问的问题
- Tomcat多实例部署及其原理
- Tomcat7配置教程
- lcentos7下安装tomcat
- Tomcat学习链接