catalina.sh中设置-Xms(初始堆)和-Xmx(最大堆),建议设为物理内存的80%,如-Xms2g -Xmx2g。-XX:+UseG1GC,并调整相关参数(如-XX:MaxGCPauseMillis控制GC停顿时间)。server.xml中配置maxThreads(最大线程数,建议500-1000)、minSpareThreads(最小空闲线程数,建议50-100)、acceptCount(等待队列长度,建议100-200)。protocol="org.apache.coyote.http11.Http11Nio2Protocol"),提升并发处理能力。compression="on",减少传输数据量。/etc/security/limits.conf,设置* soft nofile 65536和* hard nofile 65536。/etc/sysctl.conf,如net.core.somaxconn=65535、net.ipv4.tcp_tw_reuse=1,提升网络性能。/etc/rc.local中添加echo never > /sys/kernel/mm/transparent_hugepage/enabled。参考来源:[1,2,3,4,5,6,7,8,9,10,11]