tomcat7连接器配置,bio与nio连接器


tomcat7 BIO 配置

<Connector port="8080" protocol="HTTP/1.1"

<pre name="code" class="html"><span style="font-size:18px;">
               connectionTimeout="60000"
               redirectPort="8443" URIEncoding="UTF-8"
               maxThreads="1000" 
               minSpareThreads="100"     
               maxSpareThreads="1000" 
               acceptCount="1000"/></span>
 

maxThreads  最大连接线程数,从Jvm虚拟器显示有多少个线程创建。它用于接收http请求。

acceptCount:最大http请求处理队列数,当线程数达到最大值时,其它请求将加入队列

minSpareThreads:最小空闲线程数,The minimum number of threads always kept running. If not specified, the default of 10 is used.默认为10

maxConnections:BIO模型下等于maxThreads值。The default value varies by connector type. For BIO the default is the value of maxThreads unless an Executor is used in which case the default will be the value of maxThreads from the executor. For NIO the default is 10000. For APR/native, the default is 8192.


tomcat7 NIO 配置

<Connector port="80" protocol="org.apache.coyote.http11.Http11NioProtocol" 
connectionTimeout="20000" 
URIEncoding="UTF-8" 
useBodyEncodingForURI="true" 
enableLookups="false" 
redirectPort="8443" /> 


值得注意的是

1.tomcat支持NIO2连接器

2.不同版本连接器,属性参数有些不同,有些已经过期。启动时,要注意日志提示。

tomcat参考地址:

http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#BIO_specific_configuration


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值