zoukankan      html  css  js  c++  java
  • Tomcat配置优化要点

    1、内存使用调整(Out of Memery问题)
    Tomcat 默认可以使用的内存为 128MB ,在较大型的应用项目中,这点内存是不够的,需要调大。

       Windows 下,在文件 {tomcat_home}/bin/catalina.bat , Unix 下,在文件 {tomcat_home}/bin/catalina.sh 的前面,增加如下设置:

       JAVA_OPTS='-Xms 【初始化内存大小】 -Xmx 【可以使用的最大内存】 '

      需要把这个两个参数值调大。例如:

    rem ----- Execute The Requested Command ---------------------------------------

    set JAVA_OPTS='-Xms256m -Xmx512m'

      表示初始化内存为 256MB ,可以使用的最大内存为 512MB

    2、连接线程数调整(cannot connect to server问题)

    优化tomcat配置:maxThreads="500" minSpareThreads="400" maxSpareThreads="450"。但是tomcat 最多支持500个并发访问

    3、connectionTimeout

    单位是毫秒,Connector从接受连接到提交URI的等待的时间。

    http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
    The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be presented. The default value is 60000 (i.e. 60 seconds).

    参考:
    http://twotwoandapple.blogbus.com/logs/62770043.html


    4、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.
     


     

  • 相关阅读:
    启动docker 服务时 虚拟机端口转发 外部无法访问
    ADC滤波处理的十种方法
    ubuntu卸载软件
    Cannot fetch index base URL http://pypi.python.org/simple/
    pip命令详解
    QT入门
    tensorflow学习-第一章
    opencv学习-第一章
    二叉树详解
    C/C++内存地址划分
  • 原文地址:https://www.cnblogs.com/preftest/p/1874020.html
Copyright © 2011-2022 走看看