tomcat 与 jvm 优化

1、

JAVA_OPTS="-server -Xms4000M -Xmx4000M -XX:SurvivorRatio=4 -Xss512k -XX:PermSize=512m -XX:MaxPermSize=512m -XX:-DisableExplicitGC -verbosegc -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:ParallelCMSThreads=8 -XX:ParallelGCThreads=8 -XX:MaxTenuringThreshold=5 -XX:-UseAdaptiveSizePolicy -XX:TargetSurvivorRatio=90 -XX:+ScavengeBeforeFullGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/cafe/tomcat/logs/oom-error.log -Xloggc:/opt/cafe/tomcat/logs/gc.log -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dspring.profiles.active=online"


2、

<Connector port="8080" maxHttpHeaderSize="8192"
protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="1000" minSpareThreads="100" maxSpareThreads="300"
enableLookups="false" redirectPort="8443" acceptCount="500"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>
<Engine name="Catalina" defaultHost="defaulthost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="defaulthost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/opt/cafe/logs/tomcat" prefix="access_log." suffix=".log" rotatable="true"
pattern="%a %{X-Real-IP}i %l %u %r %t %s %b %{Referer}i" resolveHosts="false" fileDateFormat="yyyy-MM-dd"/>
<Context path="" docBase="/opt/cafe/webapps/ddshow-web" reloadable="false" debug="0">
</Context>
</Host>
</Engine>



vim /opt/cafe/tomcat6_cps/bin/catalina.sh

export CATALINA_OPTS="-server -Xms4096M -Xmx4096M -XX:SurvivorRatio=4 -Xss512k -XX:PermSize=512m -XX:MaxPermSize=512m -XX:-DisableExplicitGC -verbosegc -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:-CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:ParallelCMSThreads=8 -XX:ParallelGCThreads=8 -XX:MaxTenuringThreshold=5 -XX:-UseAdaptiveSizePolicy -XX:TargetSurvivorRatio=90 -XX:+ScavengeBeforeFullGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/logs/laifeng/web/oom.log -Xloggc:/opt/logs/laifeng/web/gc.log -Dspring.profiles.active=online-stat -DshardId=1"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值