Tomcat7 设置最大连接数
来源:互联网 发布:文都医考app软件下载 编辑:程序博客网 时间:2024/05/21 17:29
minProcessors:最小空闲连接线程数,用于提高系统处理性能,默认值为10
maxProcessors:最大连接线程数,即:并发处理的最大请求数,默认值为75
acceptCount:允许的最大连接数,应大于等于maxProcessors,默认值为100
enableLookups:是否反查域名,取值为:true或false。为了提高处理能力,应设置为false
connectionTimeout:网络连接超时,单位:毫秒。设置为0表示永不超时,这样设置有隐患的。通常可设置为30000毫秒。
其中和最大连接数相关的参数为maxProcessors和acceptCount。如果要加大并发连接数,应同时加大这两个参数。
首先,在这里:http://tomcat.apache.org/ 我们点击左侧导航栏中“Documentation”下的Tomcat 7.0,进入到这个链接中:http://tomcat.apache.org/tomcat-7.0-doc/index.html ,详细的信息我们不用都看,在左侧导航栏中有一个链接Configuration,我们点进去之后,再点击其左侧导航栏中connector一项的HTTP,就进入到HTTP连接数及其他相关属性的设置页面了。在这里(http://tomcat.apache.org/tomcat-7.0-doc/config/http.html)我们可以看到,在Connector的属性配置中,压根就没有maxProcessors等的设置选项。其中这句话已经介绍得很清楚:
If more simultaneous requests are received than can be handled by the currently available request processing threads, additional threads will be created up to the configured maximum (the value of the maxThreads
attribute). If still more simultaneous requests are received, they are stacked up inside the server socket created by the Connector, up to the configured maximum (the value of the acceptCount
attribute).
所以我们需要设置的是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:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" acceptCount="500" maxThreads="400" />
- Tomcat7 设置最大连接数
- Tomcat7以及以上版本设置最大连接数和内存
- tomcat7最大并发数,等待连接数,最大连接数配置
- MySQL最大连接数设置
- MySQL最大连接数设置
- 设置oracle最大连接数
- MySQL最大连接数设置
- MySQL最大连接数设置
- 设置mysql最大连接数
- MySQL最大连接数设置
- 设置 oracle 最大连接数
- 设置mysql最大连接数
- MySQL最大连接数设置
- MySQL最大连接数设置
- MySQL最大连接数设置
- mysql 最大连接数设置
- mysql设置最大连接数
- MySQL最大连接数设置
- 第二期项目订房网错误分析
- 动态链接库(DLL)总结---解决名称粉碎问题(3)
- 小的时候.by小雷
- 在Objective-C中关于self和super功能用法的疑惑与分析-康大亮
- BitBlt
- Tomcat7 设置最大连接数
- iOS笔记UI--进度条
- C语言的谜题
- 用getAttribute获取控制层获取的数据,显示在jsp页面
- C#学习之路,学习笔记 第七章 面向对象编程:类和对象(一)
- u3d的摄像头:WebCamTexture
- Java线程死锁查看分析方法
- iOS开发14-iOS CATransform3DRotate旋转动画
- Oracle基础之Oracle的体系结构