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

本文详细介绍了Tomcat7中BIO与NIO两种连接器的配置方法及关键参数设置,包括maxThreads、acceptCount等参数的作用与意义,并提供了具体的配置示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

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 of10is used.默认为10

 

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

 

 

 

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

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值