[Mongrel] Setup with Apache 2.2 proxy balancer : timeout during uploads
hip at lan-attack.ch
Tue Aug 29 15:45:26 EDT 2006
I encounter timeout errors during file uploads in my Rails application.
I think the problem may be in the Mongrel configuration. Here is my setup:
* Load balancer (Cisco CSM, my provider's Catalyst 6509)
* Apache 2.2.3 with mod_proxy_balancer
* Mongrel 0.3.13.3
* Rails 1.1.6
* Ruby 1.8.4
* MySQL 5.0.22
I host an application in which users may upload medium files (around
2-5MB each) using an AJAX form POST, one large file at a time. Some
users succeed to upload, others do not. There seem to be no relation
between the failing users and their browsers.
I see these error messages in Apache's error_log:
[Tue Aug 29 21:28:27 2006] [error] (70007)The timeout specified has
expired: proxy: pass request body failed to 127.0.0.1:8012 (127.0.0.1)
from THE.CLIENT.IP.HERE ()
Joining these error messages with the access_log's, the failing requests
are the file uploads.
At the beginning, I had 5 Mongrel processes. I tried to increase this
value to 20 but I still see such errors. Is there any problem with
concurrency here? Does this setup do not handle a small/medium number of
concurrent uploads? The site is not yet heavily loaded, but it may be in
the near future. I hope I'll be able to fix this very soon :)
I'm not quite sure to fully understand how a request is handled by this
setup, particularly at which step the full request may be cached and
passed by to Mongrel and/or Rails fully, without waiting for the client
to finish his upload.
Also note that the system's load average is near zero, the system is
responsive, the bandwidth fully available (although the bottleneck is at
the client's end on this point).
I hope I've been clear enough and don't hesitate to ask for more logs
and debugs ! Unfortunately, I can't reproduce this problem locally and I
haven't tried Mongrel 0.3.13.4 on the production system yet.
Maybe this problem is related to the Rails code handling the upload
(which is the file_column plugin)? In this case, I will ask it on the
Any suggestion would be greatly appreciated!
More information about the Mongrel-users