美文网首页
G1回收器对应jvm和tomcat参数配置

G1回收器对应jvm和tomcat参数配置

作者: 后来丶_a24d | 来源:发表于2020-09-24 11:17 被阅读0次

参数配置

jvm参数配置

-Xmx12288m 
-Xms12288m 
-Xss256k 
-XX:MaxGCPauseMillis=200 
-XX:+UseG1GC 
-XX:-OmitStackTraceInFastThrow 
-XX:MinHeapFreeRatio=30 
-XX:MaxHeapFreeRatio=50 
-Djava.util.concurrent.ForkJoinPool.common.parallelism=8 
-XX:CICompilerCount=4 
-XX:MetaspaceSize=384m 
-XX:MaxMetaspaceSize=384m 
-XX:MinMetaspaceFreeRatio=0 
-XX:MaxMetaspaceFreeRatio=100 
-XX:G1ReservePercent=15 
-XX:+PreserveFramePointer 
-XX:+PrintGC 
-XX:+PrintGCDetails 
-XX:+PrintGCDateStamps 
-XX:+UseGCLogFileRotation 
-XX:NumberOfGCLogFiles=5 
-XX:GCLogFileSize=32M 
-XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/opt/logs/***** 
-Dport.http.server=8080 
-Dlog.server=/opt/logs/*****
-Dport.shutdown.server=8081 
-Ddocbase.server=/opt/app -Dvdir.server= 
-Djava.security.egd=file:/dev/./urandom
-Dcom.sun.management.jmxremote.authenticate=false 
-Dcom.sun.management.jmxremote.ssl=false 
-Djava.rmi.server.hostname=****** 
-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.port=8780 
-Dcom.sun.management.jmxremote.rmi.port=8780 
-Dcom.sun.management.jmxremote.local.only=false 
-Xloggc:/opt/logs/xxxx/gc.log 
-DAPPLOGDIR=/opt/logs/xxxx/applog 
-XX:ParallelGCThreads=8 
-XX:ConcGCThreads=8 -Djava.util.concurrent.ForkJoinPool.common.threadFactory=com.ctrip.forkjoinworkerthreadfactory.CtripForkJoinWorkerThreadFactory -Djdk.tls.ephemeralDHKeySize=2048 
-Dignore.endorsed.dirs= -Dcatalina.base=/opt/tomcat
-Dcatalina.home=/opt/tomcat 
-Djava.io.tmpdir=/opt/tomcat/temp

tomcat参数配置

<Server port="${port.shutdown.server}" shutdown="SHUTDOWN">
   <Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
   <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/>
   <Listener className="org.apache.catalina.core.JasperListener"/>
   <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
   <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>

   <GlobalNamingResources>
      <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml"/>
   </GlobalNamingResources>

   <Service name="Catalina">
      <Connector port="${port.http.server}" protocol="org.apache.coyote.http11.Http11NioProtocol" minSpareThreads="20" maxThreads="1024" maxConnections="10000" connectionTimeout="60000" maxHttpHeaderSize="32768" acceptCount="150" redirectPort="8443" URIEncoding="UTF-8" compression="on" compressableMimeType="application/json,application/xml,application/x-java-serialized-object,application/soap+xml,image/gif,image/png,text/css,text/html,text/javascript,text/plain,text/xml,application/fastinfoset,application/bjjson"/>
      <Engine name="Catalina" defaultHost="localhost">
         <Realm className="org.apache.catalina.realm.LockOutRealm">
            <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
         </Realm>
         <Host name="localhost" appBase="empty" unpackWARs="true" autoDeploy="true">
            <Context path="${vdir.server}" docBase="${docbase.server}" reloadable="false"/>
            <Valve className="org.apache.catalina.valves.AccessLogValve" directory="${log.server}" prefix="access." suffix="log" rotatable="false" pattern="^A%t^A%{Host}i^A%v^A%A^A%m^A"%r"^A%U^A%q^A%p^A%u^A%a^A%{X-Forwarded-For}i^A%H^A"%{User-Agent}i"^A%{Referer}i^A%s^A%B^A%D^A"%{rootmessageid}o"^A"%{x-request-id}i"^A"%{x-request-id}o""/>
         </Host>
      </Engine>
   </Service>
</Server>

相关文章

网友评论

      本文标题:G1回收器对应jvm和tomcat参数配置

      本文链接:https://www.haomeiwen.com/subject/xrezyktx.html