[Mongrel] [Ruby Forum] Message from user amit-singh

Luis Lavena luislavena at gmail.com
Wed Sep 22 07:44:13 EDT 2010

On Wed, Sep 22, 2010 at 6:13 AM,  <amittomer25 at yahoo.com> wrote:
>amit-singh sent you the following message:
>Sorry to send you personal message but its urgent...

Please, really, do not email me directly, I can't answer all the
questions that are emailed daily.

> hii all,
> am using apache as frontend to mongrel and loaded xsendfile
> module in apache ,am looking for 1 GB of download .this is download
> routine
> def download
> @stream = Stream.find(params[:id])
> send_file(@stream.location,:filename => @stream.name,:disposition >
> 'attachment',:x_sendfile => true )
> and
> And this is how it is processed
> Sending X-Sendfile header
> d:/dm/predator_720x480_5mbps_30fps_17minclip.264.filepart Completed in
> 57513ms (View: 0, DB: 15) | 200 OK [http://src/streams/download/6596]

It is clear that for the time it took to complete the request 57
seconds is way to much time to the request actually been delivered by
X-Sendfile headers and not by Rails.

> very first times its okk i getting full 1.1 GB of file getting
> downloaded,but when i am trying to download this 1.1 gb of file again,
> am getting failed to allocate memroy what could be soultion?? and can i
> use cache.clear before send_file function??

Do you understand that?

Rails is serving the request, the 1.1GB, not Apache.

That is why is failing.

> and more thing to again download 1.1 gb of file i have to restart my
> servers..
> and one more thing i noticed while downloading file my c driver memory
> geeting decrease...where file being stored in c drive while downloading
> thanks??

Dunno about that, but it is clear that the file is not being streamed by Apache.


1) I assume you have mongrel behind apache as reverse-proxy

2) static files are being served by Apache and not send to mongrel

3) You can check apache logs to verify that the request is actually
setting the headers.

4) Is D:/ directory available to Apache? is a mapped network drive?

5) Can you check "tasklist" or Windows Task Manager to determine which
process is the one eating the memory? Apache or Mongrel

6) When reporting a problem, try to include the more version
information as possible, like apache version, Ruby version etc.

And again, as mentioned before, search the web first and try to
determine if the problem is you (and the way you do things) or the
tools you're using by separating and analyzing each individual part of
your setup.
Luis Lavena
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

More information about the Mongrel-users mailing list