From lists at ruby-forum.com Thu Sep 2 09:28:11 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Thu, 2 Sep 2010 15:28:11 +0200 Subject: [Mongrel] No file uploads possible with mongrel? In-Reply-To: References: <2BF6584C-E227-484F-AB1C-90970192C130@allproducts.info> Message-ID: Luis Lavena wrote: > On Mon, Apr 12, 2010 at 1:59 AM, Anton Trapp > wrote: >> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run' >> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run' >> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 >> /usr/bin/mongrel_rails:19:in `load' >> /usr/bin/mongrel_rails:19 >> >> Any ideas? alternatives? >> > > If you're mentioning hundred of megabytes it might be possible that > the Ruby instance is not able to handle the file properly. > > Would be great if you can isolate this to a real minimum mongrel > handler example instead of a Rails application. > > I had successfully uploaded big files with mongrel, but honestly never > tried to upload 200mb or similar because will be suboptimal. > > -- > Luis Lavena > AREA 17 > - > 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? hii, i am trying to upload some files to filesystem using rails application when i use small size file everything is perfect but i when goes for larger files i got error this is my code #this model file class DataFile < ActiveRecord::Base def self.save(upload) name = upload['datafile'].original_filename directory = "//192.168.147.17/Smruti/streams" # create the file path path = File.join(directory, name) # write the file File.open(path, "wb") { |f| f.write(upload['datafile'].read) } end end #this is my controller class UploadController < ApplicationController def index render :file => 'app\views\upload\uploadfile.rhtml' end def uploadFile post = DataFile.save(params[:upload]) render :text => "File has been uploaded successfully" end end -- Posted via http://www.ruby-forum.com/. From gwolf at gwolf.org Thu Sep 2 20:48:49 2010 From: gwolf at gwolf.org (Gunnar Wolf) Date: Thu, 2 Sep 2010 19:48:49 -0500 Subject: [Mongrel] Mongrel Cluster fails to start In-Reply-To: <88ae17b21198399346e1db6d8e124459@ruby-forum.com> References: <88ae17b21198399346e1db6d8e124459@ruby-forum.com> Message-ID: <20100903004849.GB8289@gwolf.org> Govind Naroji dijo [Fri, Aug 27, 2010 at 07:40:16PM +0200]: > Mongrel Cluster fails to start > > Hello, > > I have an issue with Mongrel cluster start-up, when I start the cluster > I am getting the following error: > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > 'gem_original_require': no such file to load -- > /home/admin/test-project/test-app/config/environment (LoadError) > > [I have attached the log file along with this post] > (...) Just stating what's obvious: Does your application work _without_ Mongrel? As the www-data user? It smells to me that you have downloaded your Gems in your user's home directory, and they are not available for www-data. From lists at ruby-forum.com Fri Sep 3 08:19:13 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Fri, 3 Sep 2010 14:19:13 +0200 Subject: [Mongrel] No file uploads possible with mongrel? In-Reply-To: References: <2BF6584C-E227-484F-AB1C-90970192C130@allproducts.info> Message-ID: Luis Lavena wrote: > On Mon, Apr 12, 2010 at 1:59 AM, Anton Trapp > wrote: >> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run' >> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run' >> /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 >> /usr/bin/mongrel_rails:19:in `load' >> /usr/bin/mongrel_rails:19 >> >> Any ideas? alternatives? >> > > If you're mentioning hundred of megabytes it might be possible that > the Ruby instance is not able to handle the file properly. > > Would be great if you can isolate this to a real minimum mongrel > handler example instead of a Rails application. > > I had successfully uploaded big files with mongrel, but honestly never > tried to upload 200mb or similar because will be suboptimal. > > -- > Luis Lavena > AREA 17 > - > 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? yaa luis i am sending form with mutipart true option like <%= form_tag ({:action => 'uploadFile'},:multipart => true) %> -- Posted via http://www.ruby-forum.com/. From neongrau at gmail.com Mon Sep 6 10:47:53 2010 From: neongrau at gmail.com (Ralf Vitasek) Date: Mon, 6 Sep 2010 16:47:53 +0200 Subject: [Mongrel] mongrel_service on Windows Server 2008 R2 /w Run As User Message-ID: <99A531AF-5532-430B-B07E-D7A0B1BAC738@gmail.com> Hello! I need to run an older Rails App on WIndows Server 2008 R2 with a different Account then the default Local System. While the default works, when trying to start with a different User (even tried with a Domain Admin account), the service will not start (Error 1053). That problem doesn't occur with Windows Server 2003. Any idea what is required to get it to start with a different user on Windows Server 2008 R2 ? Thanks, Ralf From yu.watanabe at jp.fujitsu.com Fri Sep 10 01:04:44 2010 From: yu.watanabe at jp.fujitsu.com (Yu Watanabe) Date: Fri, 10 Sep 2010 14:04:44 +0900 Subject: [Mongrel] Abount mongrel specification Message-ID: <201009100504.AA02438@S2007337.jp.fujitsu.com> Hello all. I would like to ask a question of the session handling of mongrel. I realize that mongrel can only handle one session at once not like apache. Is there any official documentation that describes about this? Thanks! Yu Watanabe From wyhaines at gmail.com Fri Sep 10 08:30:18 2010 From: wyhaines at gmail.com (Kirk Haines) Date: Fri, 10 Sep 2010 06:30:18 -0600 Subject: [Mongrel] Abount mongrel specification In-Reply-To: <201009100504.AA02438@S2007337.jp.fujitsu.com> References: <201009100504.AA02438@S2007337.jp.fujitsu.com> Message-ID: What do you mean by "one session at a time"? Mongrel is multithreaded, and can handle multiple simultanoues connections. Kirk Haines. On Sep 9, 2010 11:31 PM, "Yu Watanabe" wrote: Hello all. I would like to ask a question of the session handling of mongrel. I realize that mongrel can only handle one session at once not like apache. Is there any official documentation that describes about this? Thanks! Yu Watanabe _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From luislavena at gmail.com Sat Sep 11 16:40:33 2010 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 11 Sep 2010 17:40:33 -0300 Subject: [Mongrel] mongrel_service on Windows Server 2008 R2 /w Run As User In-Reply-To: <99A531AF-5532-430B-B07E-D7A0B1BAC738@gmail.com> References: <99A531AF-5532-430B-B07E-D7A0B1BAC738@gmail.com> Message-ID: On Mon, Sep 6, 2010 at 11:47 AM, Ralf Vitasek wrote: > Hello! > > I need to run an older Rails App on WIndows Server 2008 R2 with a different Account then the default Local System. > While the default works, when trying to start with ?a different User (even tried with a Domain Admin account), the service will not start (Error 1053). > > That problem doesn't occur with Windows Server 2003. > > Any idea what is required to get it to start with a different user on Windows Server 2008 R2 ? Can you provide more information about what fails to get executed? Does that user have access to Ruby and the installed gems? The database or the directories where the application is installed? What are the contents of the log files? mongrel_service.log and fbservice.log. a simple test will involve using psexec to mimic the user environment you're talking and launch mongrel_rails from the command line with the same parameters you installed it. -- Luis Lavena AREA 17 - 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 From neongrau at gmail.com Mon Sep 13 05:14:01 2010 From: neongrau at gmail.com (Ralf Vitasek) Date: Mon, 13 Sep 2010 11:14:01 +0200 Subject: [Mongrel] mongrel_service on Windows Server 2008 R2 /w Run As User In-Reply-To: References: <99A531AF-5532-430B-B07E-D7A0B1BAC738@gmail.com> Message-ID: <5B02F3BC-775C-4A08-B55C-D035A02E2586@gmail.com> if i'd knew what. mongrel starts fine when started on the command line with the same use. servicefb.log: _initialize() constructor _initialize() constructor done ServiceProcess(new_name) ServiceProcess(new_name) done ServiceHost() ServiceHost() done ServiceHost.Add() _add_to_references() _add_to_references() done ServiceHost.Add() done ServiceController.RunMode() CurrentPID: 1688 ParentPID: 624 Error with OpenProcess GetLastError: 0Der Vorgang wurde erfolgreich beendet. Parent Name: ServiceController.RunMode() done ServiceHost() destructor ServiceHost() destructor done ServiceProcess() destructor ServiceProcess() destructor done _terminate() destructor _terminate() destructor done mongrel_service.log # Logfile created on 13.09.2010 10:43:22 src/mongrel_service/mongrel_service.bas:63, mongrel_service.singlemongrel.constructor: redirecting to: C:/latest/log/mongrel.log Am 11.09.2010 um 22:40 schrieb Luis Lavena: > > Can you provide more information about what fails to get executed? > > Does that user have access to Ruby and the installed gems? The > database or the directories where the application is installed? > > What are the contents of the log files? mongrel_service.log and fbservice.log. > > a simple test will involve using psexec to mimic the user environment > you're talking and launch mongrel_rails from the command line with the > same parameters you installed it. > > -- > Luis Lavena -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Sep 13 06:33:00 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Mon, 13 Sep 2010 12:33:00 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files Message-ID: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> hii , I uploaded 1 GB of file to filesystem,but now when i trying to download this 1 GB of file ,i am getting failed to allocate memory. am running mongrel as server in development mode. NoMemoryError (failed to allocate memory): C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/cache.rb:60:in `<<' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/cache.rb:60:in `expand_cache_key' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/response.rb:118:in `etag=' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/response.rb:148:in `handle_conditional_get!' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/response.rb:138:in `prepare!' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:532:in `send_response' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:526:in `process_without_filters' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in `process_without_session_ma gement_support' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in `process' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in `process' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in `handle_request' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in `dispatch_unlocked' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:123:in `dispatch' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `synchronize' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `dispatch' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in `dispatch_cgi' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in `dispatch' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel/rails.rb:76:in `process' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel/rails.rb:74:in `synchronize' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel/rails.rb:74:in `process' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:159:in `process_client' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:158:in `each' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:158:in `process_client' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in `run' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in `initialize' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in `new' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in `run' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:268:in `initialize' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:268:in `new' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:268:in `run' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/configurator.rb:282:in `run' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/configurator.rb:281:in `each' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/configurator.rb:281:in `run' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/mongrel_rails:128:in `run' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/command.rb:212:in `run' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/mongrel_rails:281 C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load_without_new_cons nt_marking' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/mongrel.rb:64 C:/InstantRails-2.0-win/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' C:/InstantRails-2.0-win/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49 C:/InstantRails-2.0-win/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' C:/InstantRails-2.0-win/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' script/server:3 ndered C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/templates/rescues/_trace (250.0ms) -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Mon Sep 13 09:53:04 2010 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 13 Sep 2010 10:53:04 -0300 Subject: [Mongrel] mongrel_service on Windows Server 2008 R2 /w Run As User In-Reply-To: <5B02F3BC-775C-4A08-B55C-D035A02E2586@gmail.com> References: <99A531AF-5532-430B-B07E-D7A0B1BAC738@gmail.com> <5B02F3BC-775C-4A08-B55C-D035A02E2586@gmail.com> Message-ID: On Mon, Sep 13, 2010 at 6:14 AM, Ralf Vitasek wrote: > if i'd knew what. > mongrel starts fine when started on the command line with the same use. Please open a GitHub issue for better documentation, I promise will tackle it :) http://github.com/fauna/mongrel_service/issues Now.. > servicefb.log: > _initialize() constructor > _initialize() constructor done > ServiceProcess(new_name) > ServiceProcess(new_name) done > ServiceHost() > ServiceHost() done > ServiceHost.Add() > _add_to_references() > _add_to_references() done > ServiceHost.Add() done > ServiceController.RunMode() > CurrentPID: 1688 > ParentPID: 624 > Error with OpenProcess > GetLastError: 0Der Vorgang wurde erfolgreich beendet. It is clear that is having problems opening the process. Can you try out the newer beta? gem install mongrel_service --pre And then try to remove and register with the new service. On the new beta we handle much better parent process detection (or at least try to be less smart). -- Luis Lavena AREA 17 - 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 From luislavena at gmail.com Mon Sep 13 09:57:01 2010 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 13 Sep 2010 10:57:01 -0300 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> Message-ID: On Mon, Sep 13, 2010 at 7:33 AM, Amit Tomar wrote: > hii , > ? ? ?I uploaded 1 GB of file to filesystem,but now when i trying to > download this 1 GB of file ,i am getting failed to allocate memory. > am running mongrel as server in development mode. > > NoMemoryError (failed to allocate memory): > ?C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/cache.rb:60:in > `<<' > ?C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/cache.rb:60:in > `expand_cache_key' This has nothing to do with Mongrel. >From the backtrace it seems you're trying to cache all the file contents in memory. What is the code you're using to serve the file? Mongrel is quite capable to serve any file from public folder without any Rails code interfering it. -- Luis Lavena AREA 17 - 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 From neongrau at gmail.com Mon Sep 13 10:02:38 2010 From: neongrau at gmail.com (Ralf Vitasek) Date: Mon, 13 Sep 2010 16:02:38 +0200 Subject: [Mongrel] mongrel_service on Windows Server 2008 R2 /w Run As User In-Reply-To: References: <99A531AF-5532-430B-B07E-D7A0B1BAC738@gmail.com> <5B02F3BC-775C-4A08-B55C-D035A02E2586@gmail.com> Message-ID: just noticed that i didn't mention that this happens with current stable and latest beta gem (no difference at all). i will open a ticket on GitHub asap, thanks alot for having a look at it! Am 13.09.2010 um 15:53 schrieb Luis Lavena: > On Mon, Sep 13, 2010 at 6:14 AM, Ralf Vitasek wrote: >> if i'd knew what. >> mongrel starts fine when started on the command line with the same use. > > Please open a GitHub issue for better documentation, I promise will tackle it :) > > http://github.com/fauna/mongrel_service/issues > > Now.. > >> servicefb.log: >> _initialize() constructor >> _initialize() constructor done >> ServiceProcess(new_name) >> ServiceProcess(new_name) done >> ServiceHost() >> ServiceHost() done >> ServiceHost.Add() >> _add_to_references() >> _add_to_references() done >> ServiceHost.Add() done >> ServiceController.RunMode() >> CurrentPID: 1688 >> ParentPID: 624 >> Error with OpenProcess >> GetLastError: 0Der Vorgang wurde erfolgreich beendet. > > It is clear that is having problems opening the process. > > Can you try out the newer beta? > > gem install mongrel_service --pre > > And then try to remove and register with the new service. > > On the new beta we handle much better parent process detection (or at > least try to be less smart). > > -- > Luis Lavena > AREA 17 > - > 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 From lists at ruby-forum.com Tue Sep 14 01:49:55 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Tue, 14 Sep 2010 07:49:55 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> Message-ID: Luis Lavena wrote: > On Mon, Sep 13, 2010 at 7:33 AM, Amit Tomar > wrote: >> hii , >> ? ? ?I uploaded 1 GB of file to filesystem,but now when i trying to >> download this 1 GB of file ,i am getting failed to allocate memory. >> am running mongrel as server in development mode. >> >> NoMemoryError (failed to allocate memory): >> ?C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/cache.rb:60:in >> `<<' >> ?C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/cache.rb:60:in >> `expand_cache_key' > > This has nothing to do with Mongrel. > >>From the backtrace it seems you're trying to cache all the file > contents in memory. > > What is the code you're using to serve the file? Mongrel is quite > capable to serve any file from public folder without any Rails code > interfering it. > -- > Luis Lavena > AREA 17 > - > 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? Luis ,this is how am downloading my files send_data(@data,:filename => @containerformat.name+extension, :disposition => 'attachment') but i am getting error failed to allocate memory for large files ,for small files it's working fine and one thing more i observed while uploading large files , whenever i upload data more than 2gb from IE OR from mozila ,both restarts but for google chorme its working fine??? -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Tue Sep 14 07:45:27 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 14 Sep 2010 08:45:27 -0300 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> Message-ID: On Tue, Sep 14, 2010 at 2:49 AM, Amit Tomar wrote: > > Luis ,this is how am downloading my files > > send_data(@data,:filename => @containerformat.name+extension, > ? ? ? ?:disposition => 'attachment') > but i am getting error failed to allocate memory for large files ,for > small files it's working fine > Because send_data will try to load the whole file in memory. http://apidock.com/rails/ActionController/Streaming/send_data Since the file is not dynamically generated, serve it directly, don't put it behind Rails. > and one thing more i observed while uploading large files , whenever i > upload data more than 2gb from IE OR from mozila ,both restarts but for > google chorme its working fine??? Neither IE or Mozilla do chunked uploads. Chrome does and mongrels properly streams the chunked upload to a temporary file. -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Tue Sep 14 08:21:36 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Tue, 14 Sep 2010 14:21:36 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> Message-ID: Luis Lavena wrote: > On Tue, Sep 14, 2010 at 2:49 AM, Amit Tomar > wrote: >> >> Luis ,this is how am downloading my files >> >> send_data(@data,:filename => @containerformat.name+extension, >> ? ? ? ?:disposition => 'attachment') >> but i am getting error failed to allocate memory for large files ,for >> small files it's working fine >> > > Because send_data will try to load the whole file in memory. > > http://apidock.com/rails/ActionController/Streaming/send_data > > Since the file is not dynamically generated, serve it directly, don't > put it behind Rails. > >> and one thing more i observed while uploading large files , whenever i >> upload data more than 2gb from IE OR from mozila ,both restarts but for >> google chorme its working fine??? > > Neither IE or Mozilla do chunked uploads. Chrome does and mongrels > properly streams the chunked upload to a temporary file. > -- > Luis Lavena > AREA 17 > - > 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? thanks luis but could you please explain how i serve it directly and for my application i can'nt use IE because as you said it don't do chunked upload. thanks again -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Tue Sep 14 08:28:14 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 14 Sep 2010 09:28:14 -0300 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> Message-ID: On Tue, Sep 14, 2010 at 9:21 AM, Amit Tomar wrote: > > thanks luis > but could you please explain how i serve ?it directly Place the file inside public, provide the URL to the file as a link, your browser will start download once the file is served. send_data is not recommended for big file serving. > and for my > application i can'nt use ?IE because as you said it don't ?do chunked > upload. > Can't help you on that, please research about it. -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Tue Sep 14 08:39:10 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Tue, 14 Sep 2010 14:39:10 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> Message-ID: <229b30e1af467f2935307efc959cba92@ruby-forum.com> Luis Lavena wrote: > On Tue, Sep 14, 2010 at 9:21 AM, Amit Tomar > wrote: >> >> thanks luis >> but could you please explain how i serve ?it directly > > Place the file inside public, provide the URL to the file as a link, > your browser will start download once the file is served. > > send_data is not recommended for big file serving. > >> and for my >> application i can'nt use ?IE because as you said it don't ?do chunked >> upload. >> > > Can't help you on that, please research about it. > -- > Luis Lavena > AREA 17 > - > 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? sorry luis but i didn't get you i uploaded my file in filesystem than how can i place file in public folder could you please give some example?? -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Tue Sep 14 08:43:26 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 14 Sep 2010 09:43:26 -0300 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: <229b30e1af467f2935307efc959cba92@ruby-forum.com> References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> Message-ID: On Tue, Sep 14, 2010 at 9:39 AM, Amit Tomar wrote: > > sorry luis but i didn't get you > i uploaded my file in filesystem than how ?can ?i place file in public > folder > could you please give some example?? > Are you using a plugin to manage your uploads? How are you saving the file? Take the temporary file and use File.move or FileUtils.mv, wonder what are you doing right now for that. Please use google to search, there are plenty of file uploading tutorials about Ruby on Rails on the internet covering "do from scratch" or using gem/plugins. -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Tue Sep 14 08:50:21 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Tue, 14 Sep 2010 14:50:21 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> Message-ID: <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> Luis Lavena wrote: > On Tue, Sep 14, 2010 at 9:39 AM, Amit Tomar > wrote: >> >> sorry luis but i didn't get you >> i uploaded my file in filesystem than how ?can ?i place file in public >> folder >> could you please give some example?? >> > > Are you using a plugin to manage your uploads? How are you saving the > file? > > Take the temporary file and use File.move or FileUtils.mv, wonder what > are you doing right now for that. > > Please use google to search, there are plenty of file uploading > tutorials about Ruby on Rails on the internet covering "do from > scratch" or using gem/plugins. > -- > Luis Lavena > AREA 17 > - > 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? this is how am uploading def upload(params) path = get_path(params) File.open(path, "wb") do |f| while buff= params[:location].read(4096) f.write(buff) end end end def get_path(params) name = params[:location].original_filename directory = "//192.168.247.77/Smruti/streams" path = File.join(directory, name) return path end def copyFile(uploaded_file) @uploaded_file = uploaded_file directory = "//192.168.147.17/Smruti/streams" #url_dir = "data" url_dir = "//192.168.147.17/Smruti/streams" name = File.basename(@uploaded_file) path = File.join(directory, name) if (!FileTest.exist?(path)) FileUtils.copy @uploaded_file, path else return "duplicate" end url = File.join(url_dir, name) return url end end and after copying it filesystem -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Sep 14 09:03:36 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Tue, 14 Sep 2010 15:03:36 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> Message-ID: Amit Tomar wrote: > >> 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? > > luis i put file in public folder but now i have four copies of same file one is mongel temp file ,2nd cgi file,3rd in filesyste and 4th in public for large don't you think its not efficient approch ?? -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Tue Sep 14 09:11:24 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 14 Sep 2010 10:11:24 -0300 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> Message-ID: On Tue, Sep 14, 2010 at 9:50 AM, Amit Tomar wrote: > > this is how am uploading > def upload(params) > > ? ? ? ?path = get_path(params) > ? ? ? ?File.open(path, "wb") do |f| > ? ? ? ?while buff= params[:location].read(4096) > > ? ? ? ?f.write(buff) > ? ? ? ?end > ? ? ? ?end > end > That is copying the file every 4k for you, you can simply File.move form the temporay filename to the final name in your remote location. It is expected you dispose the temporary file when you're done with it. Please see how proper file uploading and processing is done with Ruby on Rails. -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Tue Sep 14 09:18:56 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Tue, 14 Sep 2010 15:18:56 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> Message-ID: Luis Lavena wrote: > On Tue, Sep 14, 2010 at 9:50 AM, Amit Tomar > wrote: >> ? ? ? ?end >> end >> > > That is copying the file every 4k for you, you can simply File.move > form the temporay filename to the final name in your remote location. > > It is expected you dispose the temporary file when you're done with it. > > Please see how proper file uploading and processing is done with Ruby on > Rails. > -- > Luis Lavena > AREA 17 > - > 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? Thanks luis you said right ,i have to check how uploading takes place.. could you suggest some documnet ?? -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Tue Sep 14 09:35:53 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 14 Sep 2010 10:35:53 -0300 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> Message-ID: On Tue, Sep 14, 2010 at 10:18 AM, Amit Tomar wrote: > > Thanks luis > you said right ,i have to check how uploading takes place.. > could you suggest some documnet ?? Google is your friend, "Rails File upload" http://www.rubyinside.com/rails-file-uploading-101-406.html And others. If the files are located in a remote server that is not in public directory, then you will not have alternative but use something like apache to serve map the files to the remote disk and serve them. But please, avoid send_data at any cost, and even the file reading/writing you're doing, because with the size you're working, you're just slowing your application with IO operations. -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Tue Sep 14 10:14:29 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Tue, 14 Sep 2010 16:14:29 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> Message-ID: <973fce7cc7a06939e3174c632eced7b0@ruby-forum.com> Luis Lavena wrote: > On Tue, Sep 14, 2010 at 10:18 AM, Amit Tomar > wrote: >> >> Thanks luis >> you said right ,i have to check how uploading takes place.. >> could you suggest some documnet ?? > > Google is your friend, "Rails File upload" > > http://www.rubyinside.com/rails-file-uploading-101-406.html > > And others. > > If the files are located in a remote server that is not in public > directory, then you will not have alternative but use something like > apache to serve map the files to the remote disk and serve them. > > But please, avoid send_data at any cost, and even the file > reading/writing you're doing, because with the size you're working, > you're just slowing your application with IO operations. > -- > Luis Lavena > AREA 17 > - > 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? luis ,but do n't have option other than send_data and one thing i can do is while downloading large files i can do it in chunks but i only download 4096 byte ,this is my code File.open(@containerformat.location,"rb")do |f| @data = f.read(4096) end ext = File.extname(@containerformat.streamName) send_data(@data,:filename => name+extension, :disposition => 'attachment') end what happening here.. -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Tue Sep 14 10:39:49 2010 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 14 Sep 2010 11:39:49 -0300 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: <973fce7cc7a06939e3174c632eced7b0@ruby-forum.com> References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> <973fce7cc7a06939e3174c632eced7b0@ruby-forum.com> Message-ID: On Tue, Sep 14, 2010 at 11:14 AM, Amit Tomar wrote: > > luis ,but do n't have option other than send_data and one thing i can do > is while downloading large files i can do it in chunks but i only > download 4096 byte ,this is my code > please read about streaming data without loading all the file contents. You will need to either use rack directly or create a mongrel handler to serve these files outside rails. Rails can only deliver one full request meaning it will load the full file before completing. -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Tue Sep 14 11:11:08 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Tue, 14 Sep 2010 17:11:08 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> <973fce7cc7a06939e3174c632eced7b0@ruby-forum.com> Message-ID: <64176fdf707e8500bc50314ad6a4f102@ruby-forum.com> Luis Lavena wrote: > On Tue, Sep 14, 2010 at 11:14 AM, Amit Tomar > wrote: >> >> luis ,but do n't have option other than send_data and one thing i can do >> is while downloading large files i can do it in chunks but i only >> download 4096 byte ,this is my code >> > > please read about streaming data without loading all the file contents. > > You will need to either use rack directly or create a mongrel handler > to serve these files outside rails. > > Rails can only deliver one full request meaning it will load the full > file before completing. > > -- > Luis Lavena > AREA 17 > - > 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? File.open(@containerformat.location,"rb") do |f| pos=f.tell while @buffer = f.read(4096) ext = File.extname(@containerformat.streamName) if ext == '' extension = File.extname(@containerformat.location) #send_to_web_app(pos, buffer) send_data(@buffer,:filename => @containerformat.name+extension, :disposition => 'attachment') else send_data(@buffer,:filename => @containerformat.streamName, :disposition => 'attachment') pos=f.tell end end now am doing it like above and trying to download 284mb of file but only 211 bytes of file being downloaded.. why?? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Sep 14 11:22:50 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Tue, 14 Sep 2010 17:22:50 +0200 Subject: [Mongrel] failed to allocate memory while downloading large files In-Reply-To: <64176fdf707e8500bc50314ad6a4f102@ruby-forum.com> References: <68a25017b2376716f01165c42afb4d71@ruby-forum.com> <229b30e1af467f2935307efc959cba92@ruby-forum.com> <6aa87273eb2d101edcfe026aa64aab8d@ruby-forum.com> <973fce7cc7a06939e3174c632eced7b0@ruby-forum.com> <64176fdf707e8500bc50314ad6a4f102@ruby-forum.com> Message-ID: Sorry i think am taking lot of your time -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Sep 16 10:30:58 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Thu, 16 Sep 2010 16:30:58 +0200 Subject: [Mongrel] problem in configuring Apache to run as front server Message-ID: Hii all, i am ruuning a rails application as windows service like first i created an empty service using instsrv.exe and srvany.exe with named smruti_exp ,then i edit in regedit to make this empty service work This is how running smruti_exp as service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\smruti_exp\Parameters] Application=ruby AppParameters=script\server -b 192.168.247.49 -p 3000 AppDirectory=D:\work\Smruti1\src am running mongrel to do all work,but i would like to run apache server as front server ,so i made some chnges in http.conf files come with Apache LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_http_module modules/mod_proxy_http.so NameVirtualHost *:80 #Proxy balancer section (create one for each ruby app cluster) BalancerMember http://src:3000 # BalancerMember http://myapp:3011 #Virtual host section (create one for each ruby app you need to publish) ServerName src DocumentRoot D:/work/Smruti1/src/public/ Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all #log files ErrorLog /var/log/apache2/src_error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/src_access.log combined #Rewrite stuff RewriteEngine On # Check for maintenance file and redirect all requests RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f RewriteCond %{SCRIPT_FILENAME} !maintenance.html RewriteRule ^.*$ /system/maintenance.html [L] # Rewrite index to check for static RewriteRule ^/$ /index.html [QSA] # Rewrite to check for Rails cached page RewriteRule ^([^.]+)$ $1.html [QSA] # Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://src_cluster%{REQUEST_URI} [P,QSA,L] these are the changes i made and in host file i added 192.168.247.49 src and try to access my application like http://src but not working what is the problem -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Sep 17 07:41:43 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Fri, 17 Sep 2010 13:41:43 +0200 Subject: [Mongrel] invalid content-Length ERROR while uploading 2 GB of stream Message-ID: <3bb59211e571818da2ea7351853c6e14@ruby-forum.com> Hi all, When Trying to upload 2GB of stream i got invalid content length error am running Apache as frontend server to mongrel and chrome as my browser. One more thing one i do it with mongrel alone am able to upload this 2 GB of stream ,cud anybody tell me whats the problem and how do i configure content length in apache?? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Sep 20 06:21:09 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Mon, 20 Sep 2010 12:21:09 +0200 Subject: [Mongrel] problem in downloading large file(1.1GB) using xsendfile.so Message-ID: <99ce6f3b84c6e8bdd299bbfd969493e0@ruby-forum.com> Hi all, I am Running Apache as frontend server to mongrel and uploaded 1.1 Gb of file using my rails application .Now I am trying to download same 1.1 GB stream ,for that i loaded mod_xsendfile.so in apache httpd.conf file and using send_file function downloaded this 1.1 gb of stream successfully.but after downloading it ,again am trying to download same 1.1 gb of stream but now am getting failed to allocate memory error. what is the problem?? Thanks -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Wed Sep 22 07:44:13 2010 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Sep 2010 08:44:13 -0300 Subject: [Mongrel] [Ruby Forum] Message from user amit-singh In-Reply-To: References: Message-ID: On Wed, Sep 22, 2010 at 6:13 AM, 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. First: 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 AREA 17 - 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 From jftucker at gmail.com Wed Sep 22 08:12:33 2010 From: jftucker at gmail.com (James Tucker) Date: Wed, 22 Sep 2010 09:12:33 -0300 Subject: [Mongrel] [Ruby Forum] Message from user amit-singh In-Reply-To: References: Message-ID: <46119997-BEE1-45CC-A620-834D00C98620@gmail.com> My guess is middleware is trying to load the file to determine the etag or such. From gerhardk at prodispace.co.za Wed Sep 22 08:33:20 2010 From: gerhardk at prodispace.co.za (Gerhard Koekemoer) Date: Wed, 22 Sep 2010 14:33:20 +0200 Subject: [Mongrel] Mongrel service Message-ID: <000a01cb5a52$57352570$059f7050$@prodispace.co.za> Hi all Environment: Windows 7 64 bit Ruby 1.9.2.p0 Rails 3 I am getting the following error when I run the following command mongrel_rails service::install -N MyTestApp_4001 -p 4001 -e production: "Msvcrt-ruby18.dll is missing" Thanks in advance Gerhard -------------- next part -------------- An HTML attachment was scrubbed... URL: From luislavena at gmail.com Wed Sep 22 08:51:08 2010 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Sep 2010 09:51:08 -0300 Subject: [Mongrel] Mongrel service In-Reply-To: <000a01cb5a52$57352570$059f7050$@prodispace.co.za> References: <000a01cb5a52$57352570$059f7050$@prodispace.co.za> Message-ID: On Wed, Sep 22, 2010 at 9:33 AM, Gerhard Koekemoer wrote: > Hi all > Environment: > > Windows 7 64 bit > Ruby 1.9.2.p0 > Rails 3 > > I am getting the following error when I run the following command > mongrel_rails service::install -N MyTestApp_4001 -p 4001 ?e production: > > ?Msvcrt-ruby18.dll is missing? > You're attempting to run Ruby 1.9 with a version of mongrel that hasn't been compiled with Ruby 1.9 support. Please install the 1.2.0 prerelease version: gem install mongrel --pre Also note that "mongrel_rails start" will fail with Rails 3. Which means mongrel service will also fail. Before you report that back, see existing issues in relation to Rails 3: http://github.com/fauna/mongrel/issues -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Wed Sep 22 09:01:00 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 15:01:00 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel Message-ID: <8a026354914915c84411589ab3094de4@ruby-forum.com> 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] 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?? -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Wed Sep 22 09:04:38 2010 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Sep 2010 10:04:38 -0300 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: <8a026354914915c84411589ab3094de4@ruby-forum.com> References: <8a026354914915c84411589ab3094de4@ruby-forum.com> Message-ID: On Wed, Sep 22, 2010 at 10:01 AM, Amit Tomar wrote: > 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 > Replied your previous message to the list also. Please provide the answers to my questions. -- Luis Lavena AREA 17 - 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 From gerhardk at prodispace.co.za Wed Sep 22 09:36:23 2010 From: gerhardk at prodispace.co.za (Gerhard Koekemoer) Date: Wed, 22 Sep 2010 15:36:23 +0200 Subject: [Mongrel] Mongrel service In-Reply-To: References: <000a01cb5a52$57352570$059f7050$@prodispace.co.za> Message-ID: <001501cb5a5b$2603ad10$720b0730$@prodispace.co.za> Hi Luis Thanks for the info. The reason that I went for mongrel 1.1.5 is that the mongrel_service 0.4.2.beta3 gem requires it. If I understand you correctly: 1) Because we are runnig ruby 1.9.2 we should run mongrel 1.2.0.pre which does not play nicely with mongrel service (I get an error asking for 1.1.5). 2) The best solution would be to run 1.8.7 with mongrel 1.1.5 and mongrel_service 0.4.3.beta3 Regards, Gerhard -----Original Message----- From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Luis Lavena Sent: 22 September 2010 02:51 PM To: mongrel-users at rubyforge.org Subject: Re: [Mongrel] Mongrel service On Wed, Sep 22, 2010 at 9:33 AM, Gerhard Koekemoer wrote: > Hi all > Environment: > > Windows 7 64 bit > Ruby 1.9.2.p0 > Rails 3 > > I am getting the following error when I run the following command > mongrel_rails service::install -N MyTestApp_4001 -p 4001 ?e production: > > ?Msvcrt-ruby18.dll is missing? > You're attempting to run Ruby 1.9 with a version of mongrel that hasn't been compiled with Ruby 1.9 support. Please install the 1.2.0 prerelease version: gem install mongrel --pre Also note that "mongrel_rails start" will fail with Rails 3. Which means mongrel service will also fail. Before you report that back, see existing issues in relation to Rails 3: http://github.com/fauna/mongrel/issues -- Luis Lavena AREA 17 - 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 _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users From lists at ruby-forum.com Wed Sep 22 09:50:13 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 15:50:13 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> Message-ID: Luis Lavena wrote: > On Wed, Sep 22, 2010 at 10:01 AM, Amit Tomar > wrote: >> 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 >> > > Replied your previous message to the list also. Please provide the > answers to my questions. > -- > Luis Lavena > AREA 17 > - > 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? just now i seen your message... i am running apache 2.2.11 that comes with XAMPP 1.7.1 and mongrel version is 1.1.2, ruby version is ruby 1.8.6 luis you are saying Rails is serving the request, the 1.1GB, not Apache but how do i know rails is serving the request..or Apache 2. d:/dm is not a network drive..its folder on d drive how do i know whther it available to apache ?? i am sending you access logs of apache after few mintues -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 22 09:58:41 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 15:58:41 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> Message-ID: when i am trying to downnload following happen in logs of apache 127.0.0.1 - - [22/Sep/2010:19:11:12 +0530] "GET /streams/download/6598 HTTP/1.1" 500 1024 "http://src/streams/6598" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.33 Safari/534.3" where 6598 is id of file to be downloaded -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Wed Sep 22 10:05:16 2010 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Sep 2010 11:05:16 -0300 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> Message-ID: On Wed, Sep 22, 2010 at 10:50 AM, Amit Tomar wrote: > just now i seen your message... > i am running apache 2.2.11 that comes with XAMPP 1.7.1 and mongrel > version is > 1.1.2, > ruby version is ruby 1.8.6 > > > Rails is serving the request, the 1.1GB, not Apache > but how do i know rails is serving the request..or Apache > Please answer all the questions I put, analyze the process memory usage. If you don't see in apache serving the X-Sendfile request, then is not. Try setting the headers on your own and render nothing: Implement the first code example of this page: http://john.guen.in/past/2007/4/17/send_files_faster_with_xsendfile/ Not the plugin. > 2. d:/dm ?is not a network drive..its folder on d drive > how do i know whther it available ?to apache ?? > Try to setup a virtual server configuration that access D: and see if it works. -- Luis Lavena AREA 17 - 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 From gerhardk at prodispace.co.za Wed Sep 22 10:12:28 2010 From: gerhardk at prodispace.co.za (Gerhard Koekemoer) Date: Wed, 22 Sep 2010 16:12:28 +0200 Subject: [Mongrel] Mongrel service In-Reply-To: <001501cb5a5b$2603ad10$720b0730$@prodispace.co.za> References: <000a01cb5a52$57352570$059f7050$@prodispace.co.za> <001501cb5a5b$2603ad10$720b0730$@prodispace.co.za> Message-ID: <001601cb5a60$308bf530$91a3df90$@prodispace.co.za> Hi Luis I have now switched over to Ruby 1.8.7 and Mongrel 1.1.5 and Mongrel Service 0.4.3.beta3 just to make sure these gems are compatible with each other. Running the mongrel_rails start command: "mongrel_rails is not recognized as an internal or external command", is this the error you spoke about? Basically, it seems that there just isn't any way at all of running mongrel as a service with Rails 3. Could you confirm this? -----Original Message----- From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Gerhard Koekemoer Sent: 22 September 2010 03:36 PM To: mongrel-users at rubyforge.org Subject: Re: [Mongrel] Mongrel service Hi Luis Thanks for the info. The reason that I went for mongrel 1.1.5 is that the mongrel_service 0.4.2.beta3 gem requires it. If I understand you correctly: 1) Because we are runnig ruby 1.9.2 we should run mongrel 1.2.0.pre which does not play nicely with mongrel service (I get an error asking for 1.1.5). 2) The best solution would be to run 1.8.7 with mongrel 1.1.5 and mongrel_service 0.4.3.beta3 Regards, Gerhard -----Original Message----- From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Luis Lavena Sent: 22 September 2010 02:51 PM To: mongrel-users at rubyforge.org Subject: Re: [Mongrel] Mongrel service On Wed, Sep 22, 2010 at 9:33 AM, Gerhard Koekemoer wrote: > Hi all > Environment: > > Windows 7 64 bit > Ruby 1.9.2.p0 > Rails 3 > > I am getting the following error when I run the following command > mongrel_rails service::install -N MyTestApp_4001 -p 4001 ?e production: > > ?Msvcrt-ruby18.dll is missing? > You're attempting to run Ruby 1.9 with a version of mongrel that hasn't been compiled with Ruby 1.9 support. Please install the 1.2.0 prerelease version: gem install mongrel --pre Also note that "mongrel_rails start" will fail with Rails 3. Which means mongrel service will also fail. Before you report that back, see existing issues in relation to Rails 3: http://github.com/fauna/mongrel/issues -- Luis Lavena AREA 17 - 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 _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users From lists at ruby-forum.com Wed Sep 22 10:22:22 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 16:22:22 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> Message-ID: <879b574a35afaf62276b5821badc35f0@ruby-forum.com> soory but how do i setup s virtual server configuration?? and i have to install that plugin?? -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Wed Sep 22 10:24:39 2010 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Sep 2010 11:24:39 -0300 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: <879b574a35afaf62276b5821badc35f0@ruby-forum.com> References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> Message-ID: On Wed, Sep 22, 2010 at 11:22 AM, Amit Tomar wrote: > > soory but how do i setup s virtual server configuration?? Read apache documentation. > and i have to install that plugin?? No, in your controller action set the headers, *do not* install the plugin. -- Luis Lavena AREA 17 - 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 From luislavena at gmail.com Wed Sep 22 10:59:44 2010 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Sep 2010 11:59:44 -0300 Subject: [Mongrel] Mongrel service In-Reply-To: <001601cb5a60$308bf530$91a3df90$@prodispace.co.za> References: <000a01cb5a52$57352570$059f7050$@prodispace.co.za> <001501cb5a5b$2603ad10$720b0730$@prodispace.co.za> <001601cb5a60$308bf530$91a3df90$@prodispace.co.za> Message-ID: On Wed, Sep 22, 2010 at 11:12 AM, Gerhard Koekemoer wrote: > Hi Luis > > I have now switched over to Ruby 1.8.7 and Mongrel 1.1.5 and Mongrel Service > 0.4.3.beta3 just to make sure these gems are compatible with each other. > > Running the mongrel_rails start command: "mongrel_rails is not recognized as > an internal or external command", is this the error you spoke about? > No. Is Ruby in your PATH? > Basically, it seems that there just isn't any way at all of running mongrel > as a service with Rails 3. Could you confirm this? > Correct. Noone has worked on fix that. -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Wed Sep 22 11:00:51 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 17:00:51 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> Message-ID: Luis Lavena wrote: > On Wed, Sep 22, 2010 at 11:22 AM, Amit Tomar > wrote: >> >> soory but how do i setup s virtual server configuration?? > > Read apache documentation. > >> and i have to install that plugin?? > > No, in your controller action set the headers, *do not* install the > plugin. > -- > Luis Lavena > AREA 17 > - > 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? luis i change my code as you said filename = "#{@stream.location}" response.headers['Content-Type'] = "application/force-download" response.headers['Content-Disposition'] = "attachment; filename=\"#{File.basename(filename)}\"" response.headers["X-Sendfile"] = filename response.headers['Content-length'] = File.size(filename) render :nothing => true this is how it is processed... -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 22 11:01:32 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 17:01:32 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> Message-ID: Amit Tomar wrote: > Luis Lavena wrote: >> On Wed, Sep 22, 2010 at 11:22 AM, Amit Tomar >> wrote: >>> >>> soory but how do i setup s virtual server configuration?? >> >> Read apache documentation. >> >>> and i have to install that plugin?? >> >> No, in your controller action set the headers, *do not* install the >> plugin. >> -- >> Luis Lavena >> AREA 17 >> - >> 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? > > luis i change my code as you said > > filename = "#{@stream.location}" > response.headers['Content-Type'] = "application/force-download" > response.headers['Content-Disposition'] = "attachment; > filename=\"#{File.basename(filename)}\"" > response.headers["X-Sendfile"] = filename > response.headers['Content-length'] = File.size(filename) > render :nothing => true > > > this is how it is processed... Processing StreamsController#download (for 127.0.0.1 at 2010-09-22 20:22:06) [GET] Parameters: {"id"=>"6600"} ?[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 (0.0ms)?[0m ?[0;1mSHOW FIELDS FROM `streams`?[0m ?[4;35;1mStream Load (0.0ms)?[0m ?[0mSELECT * FROM `streams` WHERE (`streams`.`id` = 6600) ?[0m ?[4;36;1mCACHE (0.0ms)?[0m ?[0;1mSELECT * FROM `streams` WHERE (`streams`.`id` = 6600) ?[0m 0) ?[0m Completed in 65347ms (View: 0, DB: 0) | 200 OK [http://src/streams/download/6600] -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Wed Sep 22 11:05:21 2010 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Sep 2010 12:05:21 -0300 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> Message-ID: On Wed, Sep 22, 2010 at 12:00 PM, Amit Tomar wrote: > > luis i change my code as you said > > filename = ?"#{@stream.location}" > response.headers['Content-Type'] = "application/force-download" > ?response.headers['Content-Disposition'] = "attachment; > filename=\"#{File.basename(filename)}\"" > response.headers["X-Sendfile"] = filename > response.headers['Content-length'] = File.size(filename) > render :nothing => true > > this is how it is processed... > This? How? can you provide answers to my previous questions about process memory usage? Please? -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Wed Sep 22 11:17:23 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 17:17:23 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> Message-ID: Amit Tomar wrote: > Amit Tomar wrote: >> Luis Lavena wrote: >>> On Wed, Sep 22, 2010 at 11:22 AM, Amit Tomar >>> wrote: >>>> >>>> soory but how do i setup s virtual server configuration?? >>> >>> Read apache documentation. >>> >>>> and i have to install that plugin?? >>> >>> No, in your controller action set the headers, *do not* install the >>> plugin. >>> -- >>> Luis Lavena >>> AREA 17 >>> - >>> 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? >> >> luis i change my code as you said >> >> filename = "#{@stream.location}" >> response.headers['Content-Type'] = "application/force-download" >> response.headers['Content-Disposition'] = "attachment; >> filename=\"#{File.basename(filename)}\"" >> response.headers["X-Sendfile"] = filename >> response.headers['Content-length'] = File.size(filename) >> render :nothing => true >> >> >> this is how it is processed... > > Processing StreamsController#download (for 127.0.0.1 at 2010-09-22 > 20:22:06) [GET] > Parameters: {"id"=>"6600"} > ?[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 (0.0ms)?[0m ?[0;1mSHOW FIELDS FROM > `streams`?[0m > ?[4;35;1mStream Load (0.0ms)?[0m ?[0mSELECT * FROM `streams` WHERE > (`streams`.`id` = 6600) ?[0m > ?[4;36;1mCACHE (0.0ms)?[0m ?[0;1mSELECT * FROM `streams` WHERE > (`streams`.`id` = 6600) ?[0m > 0) ?[0m > Completed in 65347ms (View: 0, DB: 0) | 200 OK > [http://src/streams/download/6600] and these are the lines i added in httpd.conf Options Indexes FollowSymLinks AllowOverride FileInfo Order allow,deny Allow from all for virtual server configuration to access D: what should i do now -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 22 11:19:24 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 17:19:24 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> Message-ID: <8df675c63084291de4810d7ed8ec55c5@ruby-forum.com> yaa am looking to provide answer for that also memory usage -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 22 11:29:02 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 17:29:02 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: <8df675c63084291de4810d7ed8ec55c5@ruby-forum.com> References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> <8df675c63084291de4810d7ed8ec55c5@ruby-forum.com> Message-ID: <24836bfd2db72a4c45d9b72642d02952@ruby-forum.com> Amit Tomar wrote: > > yaa am looking to provide answer for that also memory usage Luis when i download file httpd.exe is varied from at 49,892k to 50,264k while ruby.exe 934800 k to 1,208688k -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Wed Sep 22 11:32:01 2010 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Sep 2010 12:32:01 -0300 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: <24836bfd2db72a4c45d9b72642d02952@ruby-forum.com> References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> <8df675c63084291de4810d7ed8ec55c5@ruby-forum.com> <24836bfd2db72a4c45d9b72642d02952@ruby-forum.com> Message-ID: On Wed, Sep 22, 2010 at 12:29 PM, Amit Tomar wrote: > Amit Tomar wrote: >> >> yaa am looking to provide answer for that also memory usage > > Luis when i download file > httpd.exe ?is varied from at 49,892k to 50,264k > while ruby.exe ? ? ? ? ? ? ? ?934800 k to 1,208688k That makes then clear that Ruby is trying to read the file, not apache. Sorry, I can't help you more if you don't keep an structure conversation and you investigate also. -- Luis Lavena AREA 17 - 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 From luislavena at gmail.com Wed Sep 22 11:33:54 2010 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 22 Sep 2010 12:33:54 -0300 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> Message-ID: On Wed, Sep 22, 2010 at 12:01 PM, Amit Tomar wrote: > > Processing StreamsController#download (for 127.0.0.1 at 2010-09-22 > 20:22:06) [GET] > ?Parameters: {"id"=>"6600"} > ??[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 (0.0ms)?[0m ? ?[0;1mSHOW FIELDS FROM > `streams`?[0m > ??[4;35;1mStream Load (0.0ms)?[0m ? ?[0mSELECT * FROM `streams` WHERE > (`streams`.`id` = 6600) ?[0m > ??[4;36;1mCACHE (0.0ms)?[0m ? ?[0;1mSELECT * FROM `streams` WHERE > (`streams`.`id` = 6600) ?[0m > 0) ?[0m > Completed in 65347ms (View: 0, DB: 0) | 200 OK > [http://src/streams/download/6600] Rails log do not help, we need to know Apache headers, responses and also mongrel headers sent to apache via the proxy. Please use curl --head on mongrel to request the URL and provide the complete output Also do the same from apache. Beyond that, I cannot help you more because I don't have time to attempt replicate your environment and scenario. -- Luis Lavena AREA 17 - 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 From lists at ruby-forum.com Wed Sep 22 11:37:46 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 17:37:46 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: <24836bfd2db72a4c45d9b72642d02952@ruby-forum.com> References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> <8df675c63084291de4810d7ed8ec55c5@ruby-forum.com> <24836bfd2db72a4c45d9b72642d02952@ruby-forum.com> Message-ID: Amit Tomar wrote: > Amit Tomar wrote: >> >> yaa am looking to provide answer for that also memory usage > > Luis when i download file > httpd.exe is varied from at 49,892k to 50,264k > while ruby.exe 934800 k to 1,208688k and louis as soon while getting downloded memoryuse of httd.exe is getting decrerase to 768 k and the when the file completely downloded memory use get down to 324 k -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 22 11:39:55 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Wed, 22 Sep 2010 17:39:55 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> <8df675c63084291de4810d7ed8ec55c5@ruby-forum.com> <24836bfd2db72a4c45d9b72642d02952@ruby-forum.com> Message-ID: Amit Tomar wrote: > Amit Tomar wrote: >> Amit Tomar wrote: >>> >>> yaa am looking to provide answer for that also memory usage >> >> Luis when i download file >> httpd.exe is varied from at 49,892k to 50,264k >> while ruby.exe 934800 k to 1,208688k > > and louis as soon while getting downloded memoryuse of httd.exe is > getting decrerase to 768 k and the when the file completely downloded > memory use get down to 324 k yaa louis tahnks for your help..... you must be very good person... -- Posted via http://www.ruby-forum.com/. From jftucker at gmail.com Wed Sep 22 11:46:11 2010 From: jftucker at gmail.com (James Tucker) Date: Wed, 22 Sep 2010 12:46:11 -0300 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> Message-ID: <3DE129B3-19BE-4D3B-A966-C16BDFF652CF@gmail.com> On 22 Sep 2010, at 12:00, Amit Tomar wrote: > luis i change my code as you said > > filename = "#{@stream.location}" > response.headers['Content-Type'] = "application/force-download" > response.headers['Content-Disposition'] = "attachment; > filename=\"#{File.basename(filename)}\"" The problem is here ^^^^ > response.headers["X-Sendfile"] = filename > response.headers['Content-length'] = File.size(filename) File.size should fail, as rails will be in Dir.pwd == Rails.root, and as such, File.size(filename) for filename with no path should fail. This should be raising Errno::ENOENT. From lists at ruby-forum.com Thu Sep 23 01:40:30 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Thu, 23 Sep 2010 07:40:30 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> <8df675c63084291de4810d7ed8ec55c5@ruby-forum.com> <24836bfd2db72a4c45d9b72642d02952@ruby-forum.com> Message-ID: <10dcc0c8af62add4949586e1ecc491f8@ruby-forum.com> but louis,how do i force apache to read the file and this problem can occur with Apache also?? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Sep 23 01:42:41 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Thu, 23 Sep 2010 07:42:41 +0200 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: <3DE129B3-19BE-4D3B-A966-C16BDFF652CF@gmail.com> References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> <3DE129B3-19BE-4D3B-A966-C16BDFF652CF@gmail.com> Message-ID: James Tucker wrote: > On 22 Sep 2010, at 12:00, Amit Tomar wrote: >> luis i change my code as you said >> >> filename = "#{@stream.location}" >> response.headers['Content-Type'] = "application/force-download" >> response.headers['Content-Disposition'] = "attachment; >> filename=\"#{File.basename(filename)}\"" > > The problem is here ^^^^ > >> response.headers["X-Sendfile"] = filename >> response.headers['Content-length'] = File.size(filename) > > File.size should fail, as rails will be in Dir.pwd == Rails.root, and as > such, File.size(filename) for filename with no path should fail. This > should be raising Errno::ENOENT. but tucker, i am getting failed to allocate memory and that is also of second time.... -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Sep 23 08:58:24 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Thu, 23 Sep 2010 14:58:24 +0200 Subject: [Mongrel] how to i force apche to handle download request Message-ID: <46e835c69fc09c19e5a6043385cce816@ruby-forum.com> hii all, Am running apche as frontend to mongrel ,i added these line in Apache's httpd.conf file LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule xsendfile_module modules/mod_xsendfile.so XSendFile on XsendFileAllowAbove on ServerName src DocumentRoot C:/InstantRails-2.0-win/rails_apps/src/public/ ProxyPass / http://localhost:3000/ ProxyPassReverse / http://localhost:3000 Now in my application i have to downlaod large stream and i don't want rails to serve it,i would like apache to server this request but with current setting rail i serving this request. this is my code for download filename = "#{@stream.location}" response.headers['Content-Type'] = "application/force-download" response.headers['Content-Disposition'] = "attachment; filename=\"#{File.basename(filename)}\"" response.headers["X-Sendfile"] = filename response.headers['Content-length'] = File.size(filename) render :nothing => true with current setting am able to downlaod files of 1.1. gb only once to download it again i have to restart both mongrel and apache... -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Sep 23 09:24:03 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Thu, 23 Sep 2010 15:24:03 +0200 Subject: [Mongrel] sendfile and mongrel In-Reply-To: <475F4D03.4090700@ruckuswireless.com> References: <475F4D03.4090700@ruckuswireless.com> Message-ID: <1a4da41b8defe699b003d7f2bad350af@ruby-forum.com> Matte Edens wrote: > I use X_SendFile with Apache 2.2 just fine. FYI. > Matt how do i force apche to handle downlaod request?? -- Posted via http://www.ruby-forum.com/. From wyhaines at gmail.com Thu Sep 23 10:34:40 2010 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 23 Sep 2010 08:34:40 -0600 Subject: [Mongrel] sendfile and mongrel In-Reply-To: <1a4da41b8defe699b003d7f2bad350af@ruby-forum.com> References: <475F4D03.4090700@ruckuswireless.com> <1a4da41b8defe699b003d7f2bad350af@ruby-forum.com> Message-ID: On Thu, Sep 23, 2010 at 7:24 AM, Amit Tomar wrote: > Matte Edens wrote: >> I use X_SendFile with Apache 2.2 just fine. ?FYI. >> > > > Matt how do i force apche to handle downlaod request?? Wow. This is an ancient thread that you just hijacked. This is 100000% an Apache configuration issue. It doesn't have anything to do with Mongrel, or with Ruby in the other thread on ruby-talk that you've been beating Luis up on. Kirk Haines From jftucker at gmail.com Thu Sep 23 13:00:52 2010 From: jftucker at gmail.com (James Tucker) Date: Thu, 23 Sep 2010 14:00:52 -0300 Subject: [Mongrel] problem in downloading large file with apache+mongrel In-Reply-To: References: <8a026354914915c84411589ab3094de4@ruby-forum.com> <879b574a35afaf62276b5821badc35f0@ruby-forum.com> <3DE129B3-19BE-4D3B-A966-C16BDFF652CF@gmail.com> Message-ID: <8F0011A8-C913-43F2-AB74-C3C72BFA66C2@gmail.com> On 23 Sep 2010, at 02:42, Amit Tomar wrote: > James Tucker wrote: >> On 22 Sep 2010, at 12:00, Amit Tomar wrote: >>> luis i change my code as you said >>> >>> filename = "#{@stream.location}" >>> response.headers['Content-Type'] = "application/force-download" >>> response.headers['Content-Disposition'] = "attachment; >>> filename=\"#{File.basename(filename)}\"" >> >> The problem is here ^^^^ >> >>> response.headers["X-Sendfile"] = filename >>> response.headers['Content-length'] = File.size(filename) >> >> File.size should fail, as rails will be in Dir.pwd == Rails.root, and as >> such, File.size(filename) for filename with no path should fail. This >> should be raising Errno::ENOENT. > > but tucker, i am getting failed to allocate memory and that is also of > second time.... You confuse me for someone that doesn't read. You also clearly don't understand "should", or what I've just told you. From lists at ruby-forum.com Mon Sep 27 04:14:34 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Mon, 27 Sep 2010 10:14:34 +0200 Subject: [Mongrel] sendfile and mongrel In-Reply-To: References: <475F4D03.4090700@ruckuswireless.com> <1a4da41b8defe699b003d7f2bad350af@ruby-forum.com> Message-ID: Kirk Haines wrote: > On Thu, Sep 23, 2010 at 7:24 AM, Amit Tomar > wrote: >> Matte Edens wrote: >>> I use X_SendFile with Apache 2.2 just fine. ?FYI. >>> >> >> >> Matt how do i force apche to handle downlaod request?? > > Wow. This is an ancient thread that you just hijacked. > > This is 100000% an Apache configuration issue. It doesn't have > anything to do with Mongrel, or with Ruby in the other thread on > ruby-talk that you've been beating Luis up on. > > > Kirk Haines Kirk do u have any idea ,how should resolved this problem how do configure apache to handle this download request??? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Sep 27 08:51:40 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Mon, 27 Sep 2010 14:51:40 +0200 Subject: [Mongrel] problem when downloading files with xsendfile Message-ID: Hii All, i loaded mod_xsendfile.so in apche , i added few line in httpd.conf files LoadModule xsendfile_module modules/mod_xsendfile.so XSendFile on XSendFileAllowAbove on ServerName src DocumentRoot C:/InstantRails-2.0-win/rails_apps/src/public/ ProxyPass / http://localhost:3000/ ProxyPassReverse / http://localhost:3000/ now in my rails application i have a streams controller and inside streams controller i have a function named download ,code for code download is below def download @stream = Stream.find(params[:id]) filename = "#{@stream.location}" response.headers['Content-Type'] = "application/force-download" response.headers['Content-Disposition'] = "attachment; filename=\"#{File.basename(filename)}\"" response.headers["X-Sendfile"] = @stream.location response.headers['Content-length'] = File.size(filename) render :nothing => true end Problem is my rails application still handling this request but i would like apache to handle this request ,can anyone tell me how i configure apche to handle this request?? Actully when i downloding files,mongrel rendering things, Processing StreamsController#download (for 127.0.0.1 at 2010-09-27 16:50:47) [GET] Parameters: {"id"=>"6655"} ?[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 (0.0ms)?[0m ?[0;1mSHOW FIELDS FROM `streams`?[0m ?[4;35;1mStream Load (0.0ms)?[0m ?[0mSELECT * FROM `streams` WHERE (`streams`.`id` = 6655) ?[0 Completed in 78ms (View: 0, DB: 0) | 200 OK [http://src/streams/download/6655] It is when i am trying to download 2.2GB of file ,file is downloaded completely,but my worry is why mongrel is rendering things if apache is handling download -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Sep 30 03:42:19 2010 From: lists at ruby-forum.com (Amit Tomar) Date: Thu, 30 Sep 2010 09:42:19 +0200 Subject: [Mongrel] how do i delete mongrel temporary file Message-ID: <527f7a3e6d815152cd21b9b01cd082c2@ruby-forum.com> Hii all, In my rails application am uploading some large file(1 Gb),and when go windows temp folder ,mongrel temporary files are gathered there,but i want to delete ,its eating disk space .. Could anyone tell me how do that?? Thanks -- Posted via http://www.ruby-forum.com/.