# Problem in downloading large file apche+mongrel

**URL:** <https://www.ruby-forum.com/t/problem-in-downloading-large-file-apche-mongrel/195369>\
**Category:** Rails\
**Created:** [September 22, 2010, 9:27am UTC](https://www.ruby-forum.com/t/problem-in-downloading-large-file-apche-mongrel/195369 "2010-09-22T09:27:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amit-singh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9f8e36/32.png) [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Post date:** [September 22, 2010, 9:27am UTC](https://www.ruby-forum.com/t/problem-in-downloading-large-file-apche-mongrel/195369/1 "2010-09-22T09:27:53Z")

</div>

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

Processing StreamsController#download (for 127.0.0.1 at 2010-09-22  
12:32:10) [GET] Parameters: {“id”=\>“6596”}

\<-[4;36;1mSQL (0.0ms)?[0m ?[0;1mSET NAMES ‘utf8’?[0m

\<-[4;35;1mSQL (0.0ms)?[0m ?[0mSET SQL\_AUTO\_IS\_NULL=0?[0m

\<-[4;36;1mStream Columns (15.0ms)?[0m ?[0;1mSHOW FIELDS FROM streams?[0m

\<-[4;35;1mStream Load (0.0ms)?[0m ?[0mSELECT \* FROM streams WHERE  
(streams.id = 6596) ?[0m

\<-[4;36;1mCACHE (0.0ms)?[0m ?[0;1mSELECT \* FROM streams WHERE  
(streams.id = 596) ? ?[0m

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](http://src/streams/download/6596)]

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??  
and more thing to again download 1.1 gb of file i have to restart my  
servers…

thanks??
