设置 TOMCAT 请求超时时间 和 最大连接数
2017-02-06 11:01
609 查看
可以通过设置tomcat下conf文件夹的server.xml文件,对请求连接数和请求超时时间进行设置。
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" acceptCount="500" maxThreads="400" />connectionTimeout以毫秒为单位,默认设置为20秒。通过修改该参数,可以修改tomcat的请求超时时间;
关于修改最大并发请求连接数,需要修改maxThreads和acceptCount两个参数,
其中,maxThreads的介绍如下:
The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 200. If an executor is associated with this
connector, this attribute is ignored as the connector will execute tasks using the executor rather than an internal thread pool.
而acceptCount的介绍为:
The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.
所以两者的默认值分别是200和100,要调整Tomcat的默认最大连接数,可以增加这两个属性的值,并且使acceptCount大于等于maxThreads
本文转载自linux社区,作者:qysh123,文章链接:http://www.linuxidc.com/Linux/2013-09/90332.htm
9f07
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" acceptCount="500" maxThreads="400" />connectionTimeout以毫秒为单位,默认设置为20秒。通过修改该参数,可以修改tomcat的请求超时时间;
关于修改最大并发请求连接数,需要修改maxThreads和acceptCount两个参数,
其中,maxThreads的介绍如下:
The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 200. If an executor is associated with this
connector, this attribute is ignored as the connector will execute tasks using the executor rather than an internal thread pool.
而acceptCount的介绍为:
The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.
所以两者的默认值分别是200和100,要调整Tomcat的默认最大连接数,可以增加这两个属性的值,并且使acceptCount大于等于maxThreads
本文转载自linux社区,作者:qysh123,文章链接:http://www.linuxidc.com/Linux/2013-09/90332.htm
9f07
相关文章推荐
- 设置 TOMCAT 请求超时时间
- linux下tomcat优化,设置最大连接数,内存,Jconsole监控
- tomcat最大连接数的设置
- 设置AFNetworking网络请求的超时时间
- [Swift 工作tips] 之 使用Alamofire做网络请求时设置请求超时(timeout)时间
- linux下tomcat设置最大连接数,设置最大内存
- 为ServerXMLHTTP对象的HTTP请求设置超时时间
- Timeout expired 超时时间已到. 达到了最大池大小 错误及Max Pool Size设置
- Timeout expired 超时时间已到. 达到了最大池大小 错误及Max Pool Size设置
- 设置Apache的HttpClient请求时间超时
- 为ServerXMLHTTP对象的HTTP请求设置超时时间
- HAPROXY/LNMP系统请求应答超时时间设置
- 设置请求超时的时间
- 基于XSocket框架的socket编程技巧(设置连接的超时时间和最大空闲时间)
- 为ServerXMLHTTP对象的HTTP请求设置超时时间
- linux下tomcat设置最大连接数,设置最大内存,使用jconsole监控
- Timeout expired 超时时间已到. 达到了最大池大小 错误及Max Pool Size设置
- 备忘-Sql server Timeout expired 超时时间已到. 达到了最大池大小 错误及Max Pool Size设置
- 为ServerXMLHTTP对象的HTTP请求设置超时时间
- 设置AFNetworking网络请求的超时时间