【问题标题】:Network Error (tcp_error) After long file processing in grails app on Tomcat 7在 Tomcat 7 上的 grails 应用程序中处理长文件后出现网络错误 (tcp_error)
【发布时间】:2014-02-04 18:33:37
【问题描述】:

我在 Grails 中创建了一个 Web 应用程序,它部署在 Tomcat 7 服务器上。该应用程序读取一个 csv 文件并执行一些繁重的操作,其中请求可能需要 5-10 分钟才能完成。在一小部分数据上运行时,应用程序运行良好。但是,如果我使用大量数据,并且请求大约需要 3 分钟以上,我会收到以下错误:

Network Error (tcp_error)  

A communication error occurred: ""  
The Web Server may be down, too busy, or experiencing other 
problems preventing it from responding to requests. 
You may wish to try again at a later time.

这是 Tomcat 的问题吗?还是基于客户端浏览器属性的超时?

我尝试在 Tomcat 的 server.xml 中设置 connectionTimeout 和 disableUploadTimeout 属性,但到目前为止还没有成功。

任何帮助将不胜感激!

【问题讨论】:

    标签: tomcat grails connection timeout


    【解决方案1】:

    我发现这个related question 谈论防火墙关闭连接,我想你正在经历类似的事情。

    如果您使用 Grails 2.3,您可以利用 Asynchronous Programming 功能来执行繁重的操作并保持连接处于活动状态(例如,在等待进程完成时每 10 秒发送一次 Ajax 调用)以避免超时.

    【讨论】:

      【解决方案2】:

      你在 Catalina.out 文件中看到了什么(

      tail -f -n100 /var/log/tomcat7/catalina.out
      

      另一个信息来源可能是系统日志:

      dmesg --ctime 
      

      我能想到的最后一个选项是:

      netstat
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-04-24
        • 2013-08-11
        • 1970-01-01
        • 2011-09-17
        相关资源
        最近更新 更多