Tomcat服務問題,Cpu100%,急需幫助,請高手指點,謝謝!!!

hopeful_liu發表於2004-05-19
問題描述:
我的網站應用執行三五天後,web就無法訪問了;進入伺服器用top命令檢視系統資源,
cpu佔用率100%,sleeping程式達到了1000多個,Tomcat後臺丟擲以下錯誤:
2004-05-18 23:20:04 Ajp13Processor[8009][69] process: invoke
java.io.IOException: Broken pipe
at java.net.SocketOutputStream.socketWrite(Native Method)
at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
at org.apache.ajp.Ajp13.send(Ajp13.java:525)
at org.apache.ajp.RequestHandler.finish(RequestHandler.java:501)
at org.apache.ajp.Ajp13.finish(Ajp13.java:395)
at org.apache.ajp.tomcat4.Ajp13Response.finishResponse(Ajp13Response.java:196)
at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:464)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
at java.lang.Thread.run(Thread.java:484)
2004-05-18 08:14:13 Ajp13Processor[8009][96] Starting background thread
2004-05-18 08:14:13 Ajp13Processor[8009][97] Starting background thread
2004-05-18 08:14:14 Ajp13Processor[8009][98] Starting background thread
2004-05-18 08:14:23 Ajp13Processor[8009][99] Starting background thread
2004-05-04 00:00:49 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:00:49 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:00:49 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:01:21 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:01:21 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:01:21 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:02:08 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:02:08 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:02:08 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:02:17 Ajp13Connector[8009] No processor available, rejecting this connection
2004-05-04 00:02:17 Ajp13Connector[8009] No processor available, rejecting this connection

透過以上分析,Tomcat在後臺一直新建了非常多的程式,但是用過的程式為什麼不能再重新使用或回收能,這點我很不明白;
我檢查資料庫操作的程式,ResultSet 和Connection都有關閉。
目前沒找出問題所在,請各位高手指點,非常感謝!!
伺服器環境:
RedHat Linux7.2+Apache1.3+mod_jk-1.3-noeapi.so+Tomcat4.06+Oracle
CPU兩個,RAM:2G SWAP:2G
應用技術架構:jsp+JavaBean+Oracle
Apache的httpd.conf主要配置:
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 20
StartServers 8
MaxClients 360
MaxRequestsPerChild 0
Tomcat的主要配置:
在catalina.sh加了JAVA_OPTS="-Xms1024m -Xmx1640m"(設定JVM最大記憶體)
Server.xml的主要配置如下:
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="100"
acceptCount="10" debug="0"/>
使用Tomcat自帶的連線池,連線池配置如下:
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<parameter>
<name>removeAbandonedTimeout</name>
<value>10</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>9000</value>
</parameter>

相關文章