以下是Tomcat在CentOS中的性能调优技巧:
/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等命令。conf/server.xml中配置Executor,合理设置maxThreads、minSpareThreads等参数。Connector协议改为org.apache.coyote.http11.Http11NioProtocol。Connector中添加compression="on"。-Xms、-Xmx等参数,选择合适的垃圾回收器(如G1)。