virgo-tomcat-server最大并发连接数的修改
首先,我们如果需要修改tomcat 7的最大连接数,我们可以去tomcat官方网站,查看Documentation
进入tomcat的官方网站http://tomcat.apache.org我们点击左侧导航栏中"Documentation"下的Tomcat 7.0
进入到这个链接后,详细的信息我们不用都看,注意在左侧导航栏Reference下有一个链接Configuration菜单选择项
我们点进去之后,再点击其左侧导航栏中connector一项的HTTP,就进入到HTTP连接数及其他相关属性的设置页面了。在这里
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html我们可以看到,在Connector的属性配置中,网上有很多文章说可以修改maxProcessors等参数
但这里的官方文档上压根就没有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 configuredmaximum (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).
所以我们需要设置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 . 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 .
所以两者的默认值分别是200和100,要调整Tomcat的默认最大连接数,可以增加这两个属性的值,并且使acceptCount大于等于maxThreads:
对于tomcat是修改./server.xml文件,对于virgo-tomcat则是修改./configuration/tomcat-server.xml文件,配置的格式都大同小异的,这里以virgo-tomcat为例
<Service name="Catalina">
<Connector port="" protocol="HTTP/1.1"
connectionTimeout=""
redirectPort="" maxThreads="" acceptCount=""
URIEncoding="UTF-8" compression="on" compressionMinSize=""
noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html,text/xml" />

其中上述配置的意义如下:
maxThreads="400" 即最大线程数,表示最多同时处理400个连接 ,默认为200
acceptCount="500" 最大排队数,当同时连接的数量达到maxThreads时,还可以接收排队的连接,超过这个连接的则直接返回拒绝连接。
简单的说,对于maxThreads,acceptCount有如下三种情况
情况1:接受一个请求,此时tomcat起动的线程数没有到达maxThreads,tomcat会起动一个线程来处理此请求。
情况2:接受一个请求,此时tomcat起动的线程数已经到达maxThreads,tomcat会把此请求放入等待队列,等待空闲线程。
情况3:接受一个请求,此时tomcat起动的线程数已经到达maxThreads,等待队列中的请求个数也达到了acceptCount,此时tomcat会直接拒绝此次请求,返回connection refused
尊重别人的劳动成果 转载请务必注明出处:http://www.cnblogs.com/5201351/p/4499169.html
virgo-tomcat-server最大并发连接数的修改的更多相关文章
- Virgo Tomcat Server 指南-Hello World
Eclipse发布了最新的Virgo Tomccat Server.VTS是一个应用服务器与OSGi紧密结合并且可以开发bundles形式的Spring web apps应用,他们同样拥有OSGi和S ...
- tomcat server location 地址的修改
如果是目录是灰色,那么请先删除现有的项目,然后Clean 修改之后,发布的目录是.具体目录与tomcat 安装目录相关 access_log
- JDK和Tomcat环境变量,以及用MyEclipse新建Web Project测试Tomcat Server
[请尊重原创版权,如需引用,请注明来源及地址] 在此之前一直用的Eclipse挺顺手的,今天突然想换MyEclipse试试,不知安装MyEclipse的时候我选错了什么选项,反正JDK和Tomcat的 ...
- tomcat server需要重启的时刻
1.修改了web project的任何配置文件,都需要重启tomcat 2.修改了任何java class文件,都需要重启tomcat server 3.在项目中添加了任何的文件,包括配置文件.jav ...
- Tomcat Server Configuration Automation Reinforcement
目录 . 引言 . 黑客针对WEB Server会有那些攻击面 . 针对Tomcat Server可以做的安全加固 . Managing Security Realms with JMX . 实现对T ...
- tomcat相关配置技巧梳理 (修改站点目录、多项目部署、限制ip访问、大文件上传超时等)
tomcat常用架构:1)nginx+tomcat:即前端放一台nginx,然后通过nginx反向代理到tomcat端口(可参考:分享一例测试环境下nginx+tomcat的视频业务部署记录)2)to ...
- eclipse新建tomcat server但是总是报404的解决方法
今天在eclipse中新建了tomcat server,但是由于一些配置出了问题,导致总是出现404报错,具体情况如下 症状: tomcat在eclipse里面能正常启动,而在浏览器中访问http:/ ...
- Apache Tomcat Server Options 选项说明
Apache Tomcat Server Options 选项说明 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neu ...
- java:安装Runtime Environment,设置Tomcat Server 的方法
Eclipse 中开发Webapp, 一般需要配置Tomcat Server, 以便在Eclipse 中进行Debug.具体的步骤如下: 1. Windows ==>Preference ==& ...
- tomcat——Server.xml
本机tomcat位置:D:\tomcat7\apache-tomcat-7.0.61 server.xml 位置:D:\tomcat7\apache-tomcat-7.0.61\conf 注意:ser ...
随机推荐
- Java SQL注入学习笔记
1 简介 文章主要内容包括: Java 持久层技术/框架简单介绍 不同场景/框架下易导致 SQL 注入的写法 如何避免和修复 SQL 注入 2 JDBC 介绍 JDBC: 全称 Java Databa ...
- 2 go语言的基础
include 内置关键字 注释方法 代码结构(常量,变量,接口,函数的定义) 导入包以及包别名 可见性规则 小练习 内置关键字(25个均为小写) break case chan const cont ...
- ubuntu 4.10~5.10 :古老的ubuntu上安装oracle10g的情况
64位的: 不用想了,安装不上,因为ubuntu库里没有提供编译环境:安装不上gcc-multilib库.也没有libc6-dev-i386库! 自己这点水平,真搞不定! 32位的: 很顺利.很顺利! ...
- ecshop学习1
ECSHOP开发中心(www.68ecshop.com) 研究一下ecshop,先安装一下.下面是整个安装步骤: 1.下载ecshop程序包,下载地址: http://download.ecshop. ...
- ActiveMq持久化数据
A:持久化为文件 这个你装ActiveMQ时默认就是这种,只要你设置消息为持久化就可以了.涉及到的配置和代码有 <persistenceAdapter> <kahaDB direct ...
- ubuntu下安装程序的五种方法
在ubuntu当中,安装应用程序我所知道的有三种方法,分别是apt-get,dpkg安装deb和make install安装源码包三种.下面针对每一种方法各举例来说明. 一.apt-get方法 使用a ...
- 【11-13】A股主要指数的市盈率(PE)估值高度
全指材料(SH000987) - 2018-11-13日,当前值:12.4646,平均值:30.54,中位数:26.09865,当前 接近历史新低.全指材料(SH000987)的历史市盈率PE详情 内 ...
- generating-ssh-keys
https://help.github.com/articles/generating-ssh-keys/ 其中 # start the ssh-agent in the background ssh ...
- [原]unity3d ios平台内存优化(一)
关于内存优化,人云亦云 各有己见.本文将通过设置Strpping Level ,减少内存使用. 先看三幅图: 1.没做任何优化,默认选项 2.设置Stripping level 为 Use micro ...
- Unity&C# Time时间相关
1.Unity Time类 1/ Time.time 表示从游戏开发到现在的时间,会随着游戏的暂停而停止计算. 2/ Time.timeSinceLevelLoad 表示从当前Scene开始到目前为止 ...