标签:
一、用JMeter创建100个线程对指定url进行压力测试。初始状态,吞吐量为8.7/s
二、参考java程序性能优化,在tomcat的catalina.bat新增配置。重新设置堆大小和永久区大小、禁用显示GC、去掉类校验、使用并行回收收集器代替串行收集器、使用CMS回收器、设置较大的survivior区,努力将对象预留在新生代、将CMS的Full GC触发的阈值设置为78%,即当老年代使用到78%时,才触发Full GC。吞吐率提高到9.4/s
set CATALINA_OPTS=%CATALINA_OPTS% "-XX:+PrintGCDetails" set CATALINA_OPTS=%CATALINA_OPTS% "-Xmx512M" set CATALINA_OPTS=%CATALINA_OPTS% "-Xms512M" set CATALINA_OPTS=%CATALINA_OPTS% "-XX:PermSize=64M" set CATALINA_OPTS=%CATALINA_OPTS% "-XX:MaxPermSize=64M" set CATALINA_OPTS=%CATALINA_OPTS% "-XX:+DisableExplicitGC" set CATALINA_OPTS=%CATALINA_OPTS% "-Xverify:none" set CATALINA_OPTS=%CATALINA_OPTS% "-XX:+UseConcMarkSweepGC" set CATALINA_OPTS=%CATALINA_OPTS% "-XX:ParallelCMSThreads=8" set CATALINA_OPTS=%CATALINA_OPTS% -XX:+UseCMSCompactAtFullCollection set CATALINA_OPTS=%CATALINA_OPTS% -XX:CMSFullGCsBeforeCompaction=0 set CATALINA_OPTS=%CATALINA_OPTS% -XX:CMSInitiatingOccupancyFraction=78 set CATALINA_OPTS=%CATALINA_OPTS% -XX:SoftRefLRUPolicyMSPerMB=0 set CATALINA_OPTS=%CATALINA_OPTS% -XX:+CMSParallelRemarkEnabled set CATALINA_OPTS=%CATALINA_OPTS% -XX:SurvivorRatio=1 set CATALINA_OPTS=%CATALINA_OPTS% -XX:+UseParNewGC
标签:
原文地址:http://blog.csdn.net/bobchao0730/article/details/51362583