zoukankan      html  css  js  c++  java
  • 设置 TOMCAT 请求超时时间 和 最大连接数

    转载 :https://blog.csdn.net/liufuwu1/article/details/54890834

    可以通过设置tomcat下conf文件夹的server.xml文件,对请求连接数和请求超时时间进行设置。

    1.  
      <Connector port="8080" protocol="HTTP/1.1"
    2.  
      connectionTimeout="20000"
    3.  
      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

  • 相关阅读:
    🔥低代码音视频开发训练营火热报名中!
    编解码再进化:Ali266 与下一代视频技术
    ICCV 2021口罩人物身份鉴别全球挑战赛冠军方案分享
    提升 RTC 音频体验 从搞懂硬件开始
    只要你有目标,只要你肯努力,成功只是时间问题
    安全感到底来自何方
    工作经验小结
    女人的出路在何方?
    那些以为过去了的
    初出茅庐
  • 原文地址:https://www.cnblogs.com/mybatis/p/9376092.html
Copyright © 2011-2022 走看看