1、
2、
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"