[Mongrel] Mongrel and memory usage
evan at cloudbur.st
Wed Nov 7 16:53:49 EST 2007
> If you need to auth the images then check out some of the auth-before-redirect modules available for various web servers.
I think Danga's Perlbal was made for just this purpose.
On Nov 7, 2007 12:01 PM, Zed A. Shaw <zedshaw at zedshaw.com> wrote:
> On Tue, 6 Nov 2007 14:34:25 +1100
> Dave Cheney <dave at cheney.net> wrote:
> > Hi Kirk,
> > I'm wondering if we're being hit by this issue in our application. We
> > generate a lot of thumbnails on the fly and use send_file to transfer
> > the data back to the browsers.
> > Checking the rails docks for send_file it indicates, that unless you
> > use the option :stream => false, the file will be read into a 4096
> > byte buffer and streamed to the client.
> > http://api.rubyonrails.com/classes/ActionController/Streaming.html#M000093
> > Is this a bug in send_file?
> You souldn't use send_file at all really, because this streams the full file into a StringIO so that mongrel can then send the StringIO outside the rails lock, and because rails is inconsistent in how it sends headers and the body.
> You should be using either x-sendfile or simply redirect to the real image. If you need to auth the images then check out some of the auth-before-redirect modules available for various web servers.
> Zed A. Shaw
> - Hate: http://savingtheinternetwithhate.com/
> - Good: http://www.zedshaw.com/
> - Evil: http://yearofevil.com/
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
More information about the Mongrel-users