当重新安装上载的文件服务器超时 [英] Server timeout when re-assembling the uploaded file

查看:164
本文介绍了当重新安装上载的文件服务器超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行一个简单的服务器应用程序,从细上传的Web客户端接收上传。它是基于精细上传的Java例子,是的tomcat6与Apache坐在它的面前,用的ProxyPass请求路由运行。我遇到了一个偶然的问题,在上传到达100%,但最终失败。在服务器日志,以及在客户端上,我可以看到Apache正在超时在代理一个502错误。

I am running a simple server app to receive uploads from a fine-uploader web client. It is based on the fine-uploader Java example and is running in Tomcat6 with Apache sitting in front of it and using ProxyPass to route the requests. I am running into an occasional problem where the upload gets to 100% but ultimately fails. In the server logs, as well as on the client, I can see that Apache is timing out on the proxy with a 502 error.

努力,看到这个自己之后,我意识到有真正的大文件时出现问题。 Java服务器应用程序是服用时间超过30秒钟,将块重新组合成一个单一的文件,因此阿帕奇会杀死连接,并停止等待。我增加了Apache的超时为300秒,这在很大程度上要解决该问题,但潜在的遗体。

After trying and seeing this myself, I realized the problem occurs with really large files. The Java server app was taking longer than 30 seconds to reassemble the chunks into a single file and so Apache would kill the connection and stop waiting. I have increased Apache Timeout to 300 seconds which should largely correct the problem but the potential remains.

这是其他方式来处理这个问题,这样虽然app组装服务器上的数据块Apache和Tomcat之间的连接没有被杀死任何想法?我目前使用2 MB块,并想也许我应该使用较大的块大小。或许用更少的块来组装服务器code可以做得更快。我可以测试,但除非加速比是戏剧性的,好像对问题仍然存在,只是在等待一个足够大的上传一起去触发他们的潜力。

Any ideas on other ways to handle this so that the connection between Apache and Tomcat is not killed while the app is assembling the chunks on the server? I am currently using 2 MB chunks and was thinking maybe I should use a larger chunk size. Perhaps with fewer chunks to assemble the server code could do it faster. I could test that but unless the speedup is dramatic it seems like the potential for problems remain and will just be waiting for a large enough upload to come along to trigger them.

推荐答案

好像你有两种选择:


  1. 在Apache的清除超时。

  2. 委派的chunk-组合努力一个单独的线程,并尽快返回到请求的响应成为可能。

通过后一种方式,你将无法让精细上传知道如果块组合操作失败,但也许你可以响应,如确定是否所有的块都可以访问之前执行几个简单的健康检查。

With the latter approach, you will not be able to let Fine Uploader know if the chunk combination operation failed, but perhaps you can perform a few quick sanity checks before responding, such as determining if all chunks are accessible.

有什么精细上传可以在这里做,问题是服务器端。经过精细上传发送请求时,它的任务完成了,直到你的服务器响应。

There's nothing Fine Uploader can do here, the issue is server side. After Fine Uploader sends the request, its job is done until your server responds.

如你所提到的,可能是合理的增加块大小,或进行其它的改变,以加快块组合操作,以减少超时的可能性(如果#1或#2的上方是不希望的)。

As you mentioned, it may be reasonable to increase the chunk size or make other changes to speed up the chunk combination operation to lessen the chance of a timeout (if #1 or #2 above are not desirable).

这篇关于当重新安装上载的文件服务器超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆