`
wh0426
  • 浏览: 55109 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
博客专栏
Group-logo
架构师的知识与实践
浏览量:55109
社区版块
存档分类
最新评论

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 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

 

 

搜索

复制

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics