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 ...
随机推荐
- 关于SpringMVC Json使用
很简单的一个东西,这里就不做过多介绍了,写一个小Demo,随手记录下. 首先,在搭好SpringMVC工程环境之后,如果想用Spring自带的Json,需要额外的添加2个JAR包: 1.jackson ...
- String学习之-深入解析String#intern
引言 在 JAVA 语言中有8中基本类型和一种比较特殊的类型String.这些类型为了使他们在运行过程中速度更快,更节省内存,都提供了一种常量池的概念.常量池就类似一个JAVA系统级别提供的缓存. 8 ...
- jmeter jdbc request 如何运行多个sql
database url:jdbc:mysql://127.0.0.1:3306/api?useUnicode=true&allowMultiQueries=true&characte ...
- Android 布局学习之——Layout(布局)详解二(常见布局和布局参数)
[Android布局学习系列] 1.Android 布局学习之——Layout(布局)详解一 2.Android 布局学习之——Layout(布局)详解二(常见布局和布局参数) 3.And ...
- daterangepicker日历插件使用参数注意问题
显示具体时间时分秒: timePicker设置为true,//有些资料写的pickerTime不太对 重点大坑:修改时间默认展示格式,把fomat写在locale中,网上很多资料说直接写在datera ...
- Asp.net mvc怎么在razor里写js代码
我试图在Razor里写JS代码,但是不行 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3 ...
- 【机翻】Deep Plug-and-Play Super-Resolution for Arbitrary
论文 (PDF) Deep Plug-and-Play Super-Resolution for Arbitrary Blur Kernels https://www.researchgate.net ...
- 【转载】MongoDB集群和实战详解
1.概述 最近有同学和网友私信我,问我MongoDB方面的问题:这里我整理一篇博客来赘述下MongoDB供大家学习参考,博客的目录内容如下: 基本操作 CRUD MapReduce 本篇文章是基于Mo ...
- anaconda-ks.cfg详解
https://blog.csdn.net/whyhonest/article/details/7555229
- NetBpm Q&A(7)
原文:NetBPM工作流的一个示例:请假审批 前言 在NetBPM的实践与应用中,大家一定会遇到各种各样的问题,笔者特建此帖, 聚集了一些典型问题,并作了初步解答.本帖将不断更新,大家有什么问题,可以 ...