工作中配置

本文详细介绍了Tomcat服务器的配置参数,包括连接器设置、线程池管理及主机配置,同时展示了Java服务的内存分配、垃圾回收策略与监控选项,为优化应用性能提供了实用指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.merchant_center(tomcat)

<Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->

    <Connector port="8001" protocol="HTTP/1.1"
               maxThreads="600" connectionTimeout="20000"
               enableLookups="false" compression="on"
               URIEncoding="UTF-8" useBodyEncodingForURI="true"
               compressableMimeType="text/html,text/xml,text/plain,text/javascript,application/json"
               redirectPort="8443" />

    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <Engine name="Catalina" defaultHost="localhost">

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="false"
            xmlValidation="false" xmlNamespaceAware="false">


      <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
            prefix="access" suffix=".log" 
            pattern="%{X-Real-IP}i %l %u %t &quot;%r&quot; %s %b &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot; &quot;%{QunarGlobal}c&quot; %h %{X-Forwarded-For}i" 
            resolveHosts="false"/>
	</Host>
    </Engine>
  </Service>
</Server>

2.menpad

java -server -Xmx512m -Xms512m -Xss512k -XX:CompressedClassSpaceSize=128m -XX:ParallelGCThreads=2 -XX:+UseG1GC -XX:MaxGCPauseMillis=200\
 -XX:InitiatingHeapOccupancyPercent=45  -XX:NewRatio=2 -XX:SurvivorRatio=8   -XX:-HeapDumpOnOutOfMemoryError\
 -XX:HeapDumpPath=/data/logs/jvm/oom_dump.log -jar  -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005  /data/service/wechat-jar/wechat_applet_api.jar \
 --spring.profiles.active=dev>/data/service/wechat-jar/log-start.out &

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值