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

来源:互联网 发布:php作业提交系统 编辑:程序博客网 时间:2024/04/30 02:40


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 0