Hi all, I''m running my rails app with dispatch.fcgi && lighttpd in a environment with memory issues(but no disk space issues). Whenever I try to upload a file via http (simple multipart form with input type file) which size is larger than memory available, the lighttpd process grows till fills all the memory and consequently crashes. What could I do to let upload files larger then memory available? Its is a pretty blocking issuee and I''m without a clue... Thank you in advance for any help. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''m shamelessly bumping my own post, but, well, really noone as a clue? Is there a way to make lighty buffer the file on the disk instead of loading it in memory? Should I upload the file in some other way? Do I have eventually to change webserver? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Well, that is a pretty sticky problem. You''ll have to decent to system level I guess. On debian systems you can call ''free'' with returns the current memory usage. This command can of course be called in Ruby(and thus Rails) and then parsed to see how much memory there is still available. But I am not sure that will do you any good. As I remember from attachment_fu you can ''validate'' the file size but only _after_ it been uploaded. So that won''t help you. Perhaps javascript could intervene clientside? Sample output free: $ free total used free shared buffers cached Mem: 239820 216752 23068 0 35112 47252 -/+ buffers/cache: 134388 105432 Swap: 498004 249752 248252 $ On Dec 14, 12:35 pm, Emanuele Ricci <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m shamelessly bumping my own post, but, well, really noone as a clue? > Is there a way to make lighty buffer the file on the disk instead of > loading it in memory? > Should I upload the file in some other way? > Do I have eventually to change webserver? > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yes it seems pretty sticky... anyway I do not seek a way to validate the file size since I need it to be uploaded even knowing that it would be larger than the memory available. To be more clear: the file going to be uploaded through the app feature will always be around 110Mb and the device has only 64 Mb of ram most of wich is obviously already taken, so loading the file in memory is out of question... There should be another way. I would hope for a way to make lighttpd buffer the file on disk... but anything else is apreciated. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I was not suggesting that you would validate the file size, I merely pointed out a problem with attachment_fu in that respect. As far as convincing Lighttpd to buffer the file to disk... I doubt you can do that. But seriously can''t you sent a piece of Javascript which does the checking? <pause> Just spoke to our JS guy and he does not believe it can be done. In php.ini there is a variable called max_post_size(usually), perhaps a Mongrel/Apache/Lighttpd takes a similar parameter? On Dec 14, 1:24 pm, Emanuele Ricci <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Yes it seems pretty sticky... > anyway I do not seek a way to validate the file size since I need it to > be uploaded even knowing that it would be larger than the memory > available. > To be more clear: the file going to be uploaded through the app feature > will always be around 110Mb and the device has only 64 Mb of ram most of > wich is obviously already taken, so loading the file in memory is out of > question... > There should be another way. I would hope for a way to make lighttpd > buffer the file on disk... but anything else is apreciated. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---