tomcat報錯INFO: Maximum number of threads (200) created for connector with address null and port 8080
一、發現問題
INFO: Maximum number of threads (200) created for connector with address null and port 8080
說明:最大線程數錯誤
解決方案:使用線程池,用較少的線程處理較多的訪問,可以提高tomcat處理請求的能力。
二、使用方法
打開/conf/server.xml增加
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="500" minSpareThreads="20" maxIdleTime="60000" />
最大線程500(一般服務器足夠),最小空閑線程數20,線程最大空閑時間60秒。接著修改<Connector>節點,增加executor屬性。
<Connector executor="tomcatThreadPool"
port="80" protocol="HTTP/1.1"
connectionTimeout="60000"
keepAliveTimeout="15000"
maxKeepAliveRequests="1"
redirectPort="443" />
三、linux中查看文件操作數
java.net.SocketException: Too many open files。當tomcat並發用戶量大的時候,單個jvm進程確實可能打開過多的文件句柄。使用lsof -p 10001|wc -l查看文件操作數。
1、ps -ef |grep tomcat
查看tomcat的進程ID,記錄ID號,假設進程ID為10001
2、lsof -p 10001|wc -l
查看當前進程id為10001的文件操作數
3、ulimit -a
查看每個用戶允許打開的最大文件數默認是1024
4、ulimit -n 65536
將允許的最大文件數調整為65536
原帖地址:https://blog.csdn.net/ygd266/article/details/8255746
最後更新:2017-04-03 20:19:10
上一篇:
WebService報錯javax.xml.ws.soap.SOAPFaultException: javax.xml.ws.WebFault.messageName()
下一篇:
weblogic.xml在項目中設置的注意點
Tomcat-connector的微調(3): processorCache與socket.processorCache
Swing動態刷新常用代碼
VMware JRE中的漏洞是否會妨礙虛擬化的實施
zend studio代碼自動提示問題,有的提示正常有的提示不正常,解決方法
基於MaxCompute方案的TFI門店銷量調研
Cocos2d-x中使用音頻CocosDenshion引擎介紹與音頻文件的預處理
獻給寫作者的完美工具介紹!
StartSSL 免費證書申請步驟以及Tomcat和Apache下的安裝
《Apache Zookeeper官方文檔》2-綜述
報告稱12月 Windows 8 市場份額上升至1.64%