1. 程式人生 > >tomcat優化---大數據量提交tomcat時,tomcat無法接收導致頁面無反應

tomcat優化---大數據量提交tomcat時,tomcat無法接收導致頁面無反應

-s nbsp 有時 nec read lai exec thread 容量

關於tomcat的一個優化問題:
有時候保存大數據量的數據時。tomcat不優化的話,頁面會沒反應。tomcat後臺並不報錯,僅僅是提示以下內容:
警告: More than the maximum number of request parameters (GET plus POST) for a s
ingle request ([10,000]) were detected. Any parameters beyond this limit have be
en ignored. To change this limit, set the maxParameterCount attribute on the Con
nector.

假設遇到此問題,就要進行優化一下tomcat的接收數據容量,詳細改動例如以下:
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"
maxThreads="150" compression="on" executor="tomcatThreadPool" URIEncoding="utf-8"
compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"
noCompressionUserAgents="gozilla, traviata" compressionMinSize="50" maxParameterCount="1000000"/>

將這段內容替換掉tomcat->conf-->server.xml中通常是69,70,71行左右的<Connector .../>內容。重新啟動tomcat就可以 。

說明一下。maxParameterCount是起作用的內容。可依據須要自行加大,詳細tomcat能接受的最大值是多少,這個還真沒考究過,只是一次100M數據量的提交應該是沒有問題的。

tomcat優化---大數據量提交tomcat時,tomcat無法接收導致頁面無反應