X-sendfile horrendously slow?

I’m using Camping (though I suspect this applies to RoR just as well,
and if you have an RoR specific answer I’d be happy to hear it, I may
switch) to do a number of things for an internal application, one of
which is transferring large files (~2GB each) between machines over the
network. I thought the easy route would just be to make an app that
when given the filename, serves you the file with the x-sendfile header.
However this is proving to be very, very, slow - I can transfer files
via SCP at about 30 mb/s over the network, whereas via Camping the file
is served at about 4 mb/s.

I’m running on WEBrick with Ruby 1.8.6. Any thoughts on what the issue
is? It seems like Ruby is doing a lot more work than it needs to, I
don’t know if it’s WEBrick (I’ve heard it is slow) or what.

Thanks!

On 6/21/07, pdovy [email protected] wrote:

I’m running on WEBrick with Ruby 1.8.6. Any thoughts on what the issue
is? It seems like Ruby is doing a lot more work than it needs to, I
don’t know if it’s WEBrick (I’ve heard it is slow) or what.

You’ll want to use another web server like nginx/apache/lighttpd.
They all have slightly different methods of doing this. nginx has the
X-Accel-Redirect, apache has mod_sendfile, lighttpd has
mod_secdownload…? I’m more familiar with nginx, but this should
provide some valid keywords to google. Good luck!


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com