Uploading medium size file fails
our software requires ca. 1GiB initialization files, which I put in a tar archive I wanted to upload into the files section of our redmine setup1.
Unfortunately the following happens with my setup of redmine:
1. the file upload completes on the http level (at least the transferred amount of data I see in iftop matches the files size)
2. the system goes into a state of high load and starts swapping, this takes a few minutes
3. sometimes I get an error message (see attached file), sometimes the browser just times out on waitng for www server, there is no error message in the log
4. memory consumption stays high, unless I manually kill the ruby process and restart
 The setup is a debian lenny 5.0 i386 system on a P4 2.4GHz with 512MiB of RAM, following the installation of redmine in a users home directory recipe. redmine is started from a daemontools svscan.
#3 Updated by Thomas Jahns about 13 years ago
- File production.log added
Eric Davis wrote:
Can you attach your log files that include the actual error? They are stored in
good hint, another file to put into log rotation.
From the log I see that ruby got an out of memory error. From what I read on some other boards, I can see that redmine does some in-memory processing of uploaded files. Is that a sensible approach? Why doesn't the file simply get dumped into a staging directory inside the redmine directory and moved to the files directory when the upload finished successfully?
I hope the backtrace is of some use.
#5 Updated by Thomas Jahns about 13 years ago
Jean-Philippe Lang wrote:
Memory consumption on file upload is fixed in r2670.
Can you confirm please?
Only partially. Yes, memory consumption did go down, but was still high and upload again failed on another file. I then tried to search for similar reports and found <http://www.jedi.be/blog/2009/04/10/rails-and-large-large-file-uploads-looking-at-the-alternatives/>. From there I decided to give mongrel a go and stopped webrick and used
mongrel_rails start -e production
to start the redmine server. That did significantly reduce memory footprint.
So I guess your fix does improve memory consumption and decrease the time for md5 computation but running mongrel is a worthwhile recommendation since redmine itself is innocent of most of the memory usage in file uploads.
#6 Updated by Thomas Jahns about 13 years ago
- Status changed from New to Resolved
That should have been:
So perhaps parsing <URL> is another issue. ;-)
#7 Updated by Jean-Philippe Lang about 13 years ago
- Category set to Attachments
- Status changed from Resolved to Closed
I use mongrel for development. I didn't even try with webrick but anyone who runs rails applications should know that webrick is not suitable for production purpose :-)
The fix is merged in 0.8-stable branch in r2681.
Thanks for the feedback.