zoukankan      html  css  js  c++  java
  • 远程监控tomcat 和配置tomcat内存

    参考 :https://yq.aliyun.com/articles/38757

    1. 远程监控配置
    # cd /root/apache-tomcat-8.0.17/bin
    # vi catalina.sh   #找到Execute The Requested Command,在上面添加,添加的位置并没要要求
    #JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.security.SecurityListener.UMASK=`umask`"
    JAVA_OPTS="$JAVA_OPTS-Dcom.sun.management.jmxremote 
            -Dcom.sun.management.jmxremote.port=9999 
            -Dcom.sun.management.jmxremote.authenticate=false 
            -Dcom.sun.management.jmxremote.ssl=false 
            -Djava.rmi.server.hostname=192.168.1.156"
    # ./startup.sh 
    # netstat -antp |grep 9999    #查看端口是否监听
     
     
     
    2.增加内存
     
    同样在上面的位置处 增加  -server -Xms768m -Xmx768m 
     

    Heap Size 最大不要超过可用物理内存的80%,一般的要将-Xms-Xmx选项设置为相同,而-Xmn1/4-Xmx

    Heap Size  不能大于物理内存 80%

     
    编辑后样式
     
     
     
     
     
     
     
     
    jvisualvm连接docker的tomcat
     
    参考  https://blog.csdn.net/wang704987562/article/details/72782774
     
    Dockerfile文件中
    FROM tomcat:7
    MAINTAINER zhixiong "zhixiong.wang@networkgrand.com"
    ENV CATALINA_OPTS="-Djava.rmi.server.hostname=192.168.246.128 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8971 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.rmi.port=8971"
    EXPOSE 8080 8971
     
    3.使用aio方式运行tomcat  介绍线程参考 http://itindex.net/detail/50701-tomcat-bio-nio.apr
  • 相关阅读:
    一个程序员的职业规划
    基于Andoird 4.2.2的Account Manager源代码分析学习:创建选定类型的系统帐号
    [置顶] C++学习书单
    js快速分享代码
    The declared package does not match the expected package
    IBM Rational Appscan Part 1
    IBM Rational Appscan: Part 2 ---reference
    阅读redis源代码的一些体会
    18 Command Line Tools to Monitor Linux Performance
    代码规范
  • 原文地址:https://www.cnblogs.com/xiaoyii/p/9074836.html
Copyright © 2011-2022 走看看