回形针处理图像时出现错误请求
我开发了一个画廊,其中图像通过ajax上传(jquery ajax upload),然后通过回形针处理。
现在,如果我上传一些文件(例如 10 个),则需要花一些时间来调整大小并复制水印。如果现在有人(在回形针渲染图像期间)尝试访问该网站,他会收到一条错误消息(错误请求,错误 URI `/502.shtml'。)
这非常烦人...是否有人知道如何解决此问题问题?
感谢您的响应
更新:
来自 webhoster 的日志文件:
[Fri Jul 08 10:31:01 2011] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:12002 (127.0.0.1) failed [Fri Jul 08 10:51:41 2011] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:12002 (127.0.0.1) failed [Fri Jul 08 11:20:00 2011] [error] [client 130.60.139.11] proxy: error reading status line from remote server 127.0.0.1, referer: http://example.org/galleries/1/edit [Fri Jul 08 15:04:19 2011] [error] [client 130.60.139.11] proxy: error reading status line from remote server 127.0.0.1, referer: http://example.org/galleries/1/edit [Fri Jul 08 15:05:01 2011] [error] [client 130.60.139.11] proxy: error reading status line from remote server 127.0.0.1, referer: http://example.org/galleries/1/edit
I developed a gallery where images were uploaded by ajax (jquery ajax upload), and then processed by paperclip.
Now if I'm uploading some files (say 10 for example) it takes paperclip a time to resize and copy the watermark. If a someone now (during paperclip renders the images) tries to access the website he gets an error message (Bad Request, bad URI `/502.shtml'. )
That's quite annoying... does someone has an idea how to fix this problem?
thx for response
update:
Logfile form webhoster:
[Fri Jul 08 10:31:01 2011] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:12002 (127.0.0.1) failed [Fri Jul 08 10:51:41 2011] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:12002 (127.0.0.1) failed [Fri Jul 08 11:20:00 2011] [error] [client 130.60.139.11] proxy: error reading status line from remote server 127.0.0.1, referer: http://example.org/galleries/1/edit [Fri Jul 08 15:04:19 2011] [error] [client 130.60.139.11] proxy: error reading status line from remote server 127.0.0.1, referer: http://example.org/galleries/1/edit [Fri Jul 08 15:05:01 2011] [error] [client 130.60.139.11] proxy: error reading status line from remote server 127.0.0.1, referer: http://example.org/galleries/1/edit
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
502 错误是“错误网关”错误,这是代理服务器在通信出现问题时有时会抛出的错误。在不知道您的设置细节的情况下,很难确定,但我怀疑您的图像处理正在耗尽所有可用连接,因此您的客户端无法连接到您的网站,或者您得到随机网络错误掩盖了服务器上发生的事情。
我建议在 Rails 日志中查找引发这些 502 错误的请求,看看是否有任何有用的信息。如果没有(我怀疑您找不到任何东西),这可能是您的网络服务器参数的问题,您需要提供更多相关信息。
A 502 error is a "Bad Gateway" error, which is something proxy servers throw sometimes when communication goes wrong. Without knowing the details of your setup, it's hard to say for sure, but I would suspect that either your image processing is using up all available connections, so that your client isn't able to connect to your website, or you're getting a random network error which is masking something happening on your servers.
I would recommend looking in the Rails log for the requests that are throwing these 502 errors and see if there's anything helpful there. If not (and I suspect you won't find anything), this is probably an issue with your web server parameters, and you'll need to provide more information on that.