现在的位置: 首页 > 综合 > 正文

tomcat优化—大数据量提交tomcat时,tomcat无法接收导致页面无反应

2017年12月03日 ⁄ 综合 ⁄ 共 879字 ⁄ 字号 评论关闭

关于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数据量的提交应该是没有问题的。

抱歉!评论已关闭.