<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN"><Listener className="org.apache.catalina.startup.VersionLoggerListener" /><Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /><!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --><Listener className="org.apache.catalina.core.JasperListener" /><!-- Prevent memory leaks due to use of particular java/javax APIs--><Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /><Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /><Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /><GlobalNamingResources><Resource name="UserDatabase" auth="Container"type="org.apache.catalina.UserDatabase"description="User database that can be updated and saved"factory="org.apache.catalina.users.MemoryUserDatabaseFactory"pathname="conf/tomcat-users.xml" /></GlobalNamingResources><Service name="Catalina"><!--<Connector port="8080" protocol="HTTP/1.1"   connectionTimeout="20000"   redirectPort="8443" />--><!-- Define an AJP 1.3 Connector on port 8080 --><!-- maxThreads 请求处理线程的最大数量。默认值是200(Tomcat7和8都是的)。如果该Connector绑定了Executor,这个值会被忽略,因为该Connector将使用绑定的Executor,而不是内置的线程池来执行任务--><!-- acceptCount accept队列的长度;当accept队列中连接的个数达到acceptCount时,队列满,进来的请求一律被拒绝。默认值是100--><!-- connectionTimeout Tomcat在任意时刻接收和处理的最大连接数。当Tomcat接收的连接数达到maxConnections时,Acceptor线程不会读取accept队列中的连接;这时accept队列中的线程会一直阻塞着,直到Tomcat接收的连接数小于maxConnections。如果设置为-1,则连接数不受限制。--><Connector port="8009" protocol="AJP/1.3" redirectPort="8443" maxThreads="600" minSpareThreads="100" maxSpareThreads="500" acceptCount="700" connectionTimeout="20000"/><Engine name="Catalina" defaultHost="localhost"><Realm className="org.apache.catalina.realm.LockOutRealm"><Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/></Realm><Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true"><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log." suffix=".txt"pattern="%h %l %u %t "%r" %s %b" /></Host></Engine></Service>
</Server>

  

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.

转载于:https://www.cnblogs.com/qianjinyan/p/9257149.html

简单介绍tomcat中maxThreads,acceptCount,connectionTimeout相关推荐

  1. 简单介绍Tomcat中catalina.out 和 catalina.log的区别和用途

    本文主要介绍了Tomcat中catalina.out 和 catalina.log的区别和用途详解,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 catalina. ...

  2. 简单介绍Java中Comparable和Comparator

    转载自 简单介绍Java中Comparable和Comparator Comparable 和 Comparator是Java核心API提供的两个接口,从它们的名字中,我们大致可以猜到它们用来做对象之 ...

  3. python中len用法_简单介绍Python中的len()函数的使用

    简单介绍Python中的len()函数的使用 函数:len() 1:作用:返回字符串.列表.字典.元组等长度 2:语法:len(str) 3:参数:str:要计算的字符串.列表.字典.元组等 4:返回 ...

  4. 简述python中的几种数据类型,简单介绍Python中的几种数据类型

    简单介绍Python中的几种数据类型 python 里面分为 基本数据类型 和 复合数据类型 基本数据类型包括:数值 字符串 布尔 和 none 复合数据类型包括:列表 元组 字典 和集合怎么算是深情 ...

  5. 简单介绍Python中的几种数据类型

    大体上把Python中的数据类型分为如下几类: Number(数字) 包括int,long,float,complex String(字符串) 例如:hello,"hello",h ...

  6. len函数python返回值类型_简单介绍Python中的len()函数的使用

    01状态机介绍 游戏中的状态机一般都是有限状态机,简写为FSM(有限状态机),简称状态机,是表示有限个状态以及在这些状态之间的转移和动作等行为的数学模型. 状态机的每一个状态至少需要有以下三个操作: ...

  7. 简单介绍SQLserver中的declare变量用法

    这篇文章主要介绍了SQLserver中的declare变量用法,sql中declare是声明的意思,就是声明变量的,这个一般是用在函数和存储过程中的.感兴趣的可以来了解一下 平时写SQL查询.存储过程 ...

  8. 转载:简单介绍Python中的try和finally和with方法

    用 Python 做一件很平常的事情: 打开文件, 逐行读入, 最后关掉文件; 进一步的需求是, 这也许是程序中一个可选的功能, 如果有任何问题, 比如文件无法打开, 或是读取出错, 那么在函数内需要 ...

  9. java编译时注解_简单介绍 Java 中的编译时注解

    1. 前言 上一篇 主要介绍了什么是 注解 (Annotation) 以及如何读取 运行时注解 中的数据, 同时用注解实现了简单的 ORM 功能. 这次介绍另一部分: 如何读取 编译时注解 ( Ret ...

最新文章

  1. 医疗领域中的AI/ML机会前景
  2. 最新8篇ICML2020投稿论文:自监督学习、联邦学习、图学习、数据隐私、语言模型、终身学习…...
  3. SAP PM 设备维护事务码收集整理
  4. 一个完整的python项目源码-一个Python开源项目-腾讯哈勃沙箱源码剖析(上)
  5. python电脑要求-学python对电脑配置有要求么
  6. epoll和select区别
  7. Patent Writing and cultivation of innovation thinking
  8. 常见Java面试题之解释内存中的栈、堆和静态区用法
  9. php发送数据到视图格式_PHP-FPM的相关知识的深度解释
  10. java 线程什么时候结束_java线程什么时候让出cpu?
  11. delphi ---ttoolbar,ttoolbutton
  12. ise verilog多模块编译_如何使用ISE高效开发Verilog项目(新手)
  13. Client端异步Callback的应用与介绍
  14. es6 模板字变量和字符串占位符
  15. 在JSP中使用CELL插件
  16. Netty LengthFieldBasedFrameDecoder源码分析
  17. 如何删除浏览器7654导航首页
  18. 十个常见常用的麦克劳林公式
  19. signed integer overflow: -2147483648 - 1 cannot be represented in type ‘int‘
  20. 数据标注:光鲜背后的付出

热门文章

  1. 使用CoordinatorLayout打造一个炫酷的详情页
  2. 傅里叶变化的本质:复数的实部和虚部的对应关系
  3. c语言如何快速看懂别人的程序,探究如何快速看懂单片机程序方法
  4. etcd 启动分析_Kubernetes网络分析之Flannel
  5. java 代码块的作用_Java核心(三):代码块的作用
  6. gdb加载python_gdb加载python脚本的方法
  7. html中表格的页眉页脚,有一个标准的页眉页脚布局HTML网页,而无需使用table标签...
  8. Java读取propertise配置文件_JAVA读取PROPERTIES配置文件
  9. 用yum安装配置搭建lamp环境--超简单!
  10. WIN下Nginx缓存加速配置方法