I always got scared when my client ask for upload functionality. Basically from what I''ve read that when user uploaded a file it will an instance of the web server. So if i have one dyno (instance) on heroku, while one user is uploading a big file then the application would not respond to another user request until the file is done ? I also find a couple of solution like carrierwave-direct which the file is uploaded directly to the storage server (let say S3), then rails can latter process the file. If we are to build like a social networking which involves many user uploading file in the same time, what is the correct approach to the problem? Ahmy Y -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 27, 11:56 am, Ahmy Yulrizka <ahmy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I always got scared when my client ask for upload functionality. Basically > from what I''ve read that when user uploaded a file it will an instance of > the web server. So if i have one dyno (instance) on heroku, while one user > is uploading a big file then the application would not respond to another > user request until the file is done ? >Exactly when the file upload gets handed over to rails will depend on your precise setup. On a standard apache/passenger type setup the request only gets passed into rails when the request has been fully received. I''ve not used heroku for this sort of stuff - it should be say enough to determine what exactly happens.> I also find a couple of solution like carrierwave-direct which the file is > uploaded directly to the storage server (let say S3), then rails can latter > process the file. If we are to build like a social networking which > involves many user uploading file in the same time, what is the correct > approach to the problem?S3 does indeed support pre-authenticated uploads. I''d certainly investigate this, since with heroku you''re going to have to upload the file to s3 (or similar) at some point anyway, seems like you might as well send it straight there. Fred> > Ahmy Y-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
One solution is to use transloadit.com and bypass the server entirely. On Tue, Mar 27, 2012 at 11:25 AM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Mar 27, 11:56 am, Ahmy Yulrizka <ahmy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I always got scared when my client ask for upload functionality. > Basically > > from what I''ve read that when user uploaded a file it will an instance of > > the web server. So if i have one dyno (instance) on heroku, while one > user > > is uploading a big file then the application would not respond to another > > user request until the file is done ? > > > > Exactly when the file upload gets handed over to rails will depend on > your precise setup. On a standard apache/passenger type setup the > request only gets passed into rails when the request has been fully > received. I''ve not used heroku for this sort of stuff - it should be > say enough to determine what exactly happens. > > > I also find a couple of solution like carrierwave-direct which the file > is > > uploaded directly to the storage server (let say S3), then rails can > latter > > process the file. If we are to build like a social networking which > > involves many user uploading file in the same time, what is the correct > > approach to the problem? > > S3 does indeed support pre-authenticated uploads. I''d certainly > investigate this, since with heroku you''re going to have to upload the > file to s3 (or similar) at some point anyway, seems like you might as > well send it straight there. > > Fred > > > > Ahmy Y > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I got this from the heroku documentation Pass-through uploads Pass-through uploading sends the file from the user to the application on Heroku which then uploads it to S3. Benefits of this approach include the ability to pre-process user-uploads before storing in S3. However, be careful that large files don’t tie up your application dynos during the upload process. Large files uploads in single-threaded, non-evented environments (such as Rails) block your application’s web dynos and can cause request timeouts<https://devcenter.heroku.com/articles/request-timeout> and H11, H12 errors <https://devcenter.heroku.com/articles/error-codes>. EventMachine, Node.js and JVM-based languages are less susceptible to such issues. Please be aware of this constraint and choose the right approach for your language or framework. I think that i uses thin underneath the rails application. So does that mean, rails is not suited for file upload ? Ahmy Yulrizka On Wed, Mar 28, 2012 at 1:28 AM, Martin Wawrusch <martin-qs6+VQBngv1Wk0Htik3J/w@public.gmane.org>wrote:> transloadit.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.