send_file and very large files

Showing 1-5 of 5 messages
send_file and very large files theG 4/23/10 1:14 PM
Hi

I am using sinatra and send_file for a download process. Versions as
below

[2010-04-23 20:51:43] INFO  WEBrick 1.3.1
== Sinatra/1.0 has taken the stage on 8030 for development with backup
from WEBrick
[2010-04-23 20:51:43] INFO  ruby 1.9.1 (2009-12-07) [x86_64-linux]

When i serve a large file say 500MB, sinatra seems to take ages to
start 'streaming' it. ie. in IE and FF the prompt does not come up for
a while (or not at all).

Now i read something about streaming and send_file is supposed to
chunk 8K or something. But it doesn't look like it's working. Also i
read about proxying the request to say apache.

1) is something wrong with send_file ?
2) how do you do the proxying thing to apache. i need the external url
to not detect the fact that something else is serving the file
obviously

thanks,

--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To post to this group, send email to sina...@googlegroups.com.
To unsubscribe from this group, send email to sinatrarb+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.

Re: send_file and very large files theG 4/28/10 1:17 PM
bump!
Re: send_file and very large files Nick M 5/4/10 12:05 PM
I was also seeing the same thing. After a bit of exploring, I think
this is only a problem with Webrick and Thin. If you run Mongrel or
Passenger, send_file should work properly and stream the contents of
the file without first reading it all into memory. Perhaps this caveat
could be documented in send_file's API docs?

Here's a thread about Thin's issue with Rack and streaming files:
http://groups.google.com/group/thin-ruby/browse_thread/thread/4762f8f851b965f6

Nick
Re: send_file and very large files theG 6/9/10 3:12 PM
ok thanks will give this a go

On May 4, 8:05 pm, Nick M <nick.muerd...@gmail.com> wrote:
> I was also seeing the same thing. After a bit of exploring, I think
> this is only a problem with Webrick and Thin. If you run Mongrel or
> Passenger, send_file should work properly and stream the contents of
> the file without first reading it all into memory. Perhaps this caveat
> could be documented in send_file's API docs?
>
> Here's a thread about Thin's issue with Rack and streaming files:http://groups.google.com/group/thin-ruby/browse_thread/thread/4762f8f...
Re: send_file and very large files theG 6/10/10 3:26 PM
it seemed to have worked. i had to patch one of the source files in
mongrel under ruby 1.9.1.
cheers