很久之前將Tomcat當作Web Server時,遇到的效能問題、及處理方式。在這個園地提供給需要的人參考囉!!


Linux系統要自動在開機時將Tomcat啟動的方式


 vi /etc/rc.d/rc.local   加入

/opt/Jakarta-tomcat-4.1.29/bin/startup.sh


效能調校


修改tomcat/conf/server.xml

放大connection 數目至 500



port=”80” minProcessors=”5” maxProcessors=”500”

               enableLookups=”true” redirectPort=”443”

               acceptCount=”100” debug=”0” connectionTimeout=”20000”

               useURIValidationHack=”false” disableUploadTimeout=”true” />


建議放大Java的可用記憶體配置

在 /opt/Jakarta-tomcat-4.1.29/bin/startup.sh 加入以下命令將可用記憶體配置放大至768MB(1G的記憶體)

export JAVA_OPTS=-Xmx768m  

重新啟動tomcat

arrow
arrow
    全站熱搜

    pcshu 發表在 痞客邦 留言(0) 人氣()