Is there a way to tweak rails 1.0 or 1.1-rc1 to use less RAM? I''m using a VPS (Linux UML) with < 160 MB RAM and would like to explore ways to make rails run more efficiently under such constraints. Are there articles/tips about this or do I need to look into this from scratch? -- Posted via http://www.ruby-forum.com/.
Rails wrote:> Is there a way to tweak rails 1.0 or 1.1-rc1 to use less RAM? > > I''m using a VPS (Linux UML) with < 160 MB RAM and would like to explore > ways to make rails run more efficiently under such constraints. > > Are there articles/tips about this or do I need to look into this from > scratch?Two things I''m aware of: 1) don''t use more FCGI processes than you need - one or two should be fine unless you have many users 2) don''t load Rails frameworks that you aren''t using: see config/environment.rb around line 15: # Skip frameworks you''re not going to use # config.frameworks -= [ :action_web_service, :action_mailer ] Uncomment the second line shown if you are not using ActionWebService or ActionMailer. HTH Justin
Another option is to recompile your binaries with -Os if your compiler supports the flag (only very old versions of gcc don''t use this flag properly). This does provide a sizable decrease in binary size and thus the code size in memory. On 3/24/06, Justin Forder <justin@justinforder.me.uk> wrote:> > Rails wrote: > > Is there a way to tweak rails 1.0 or 1.1-rc1 to use less RAM? > > > > I''m using a VPS (Linux UML) with < 160 MB RAM and would like to explore > > ways to make rails run more efficiently under such constraints. > > > > Are there articles/tips about this or do I need to look into this from > > scratch? > > Two things I''m aware of: > > 1) don''t use more FCGI processes than you need - one or two should be > fine unless you have many users > > 2) don''t load Rails frameworks that you aren''t using: see > config/environment.rb around line 15: > > # Skip frameworks you''re not going to use > # config.frameworks -= [ :action_web_service, :action_mailer ] > > Uncomment the second line shown if you are not using ActionWebService or > ActionMailer. > > HTH > > Justin > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060325/ebdce886/attachment.html
As well as the memory Rails uses, you should look at the memory it''s supporting processes such as the spawner / reaper are using. I have a 128Mb Xen based VPS and switched to using runit for process supervision with the help of the capistrano-runit-tasks library I wrote. I''ve just replied to Roberto Saccon in the ANN: capistrano-runit- tasks 0.2.0 thread with more details so have a look at that. Cheers, Chris On 24 Mar 2006, at 22:36, Rails wrote:> Is there a way to tweak rails 1.0 or 1.1-rc1 to use less RAM? > > I''m using a VPS (Linux UML) with < 160 MB RAM and would like to > explore > ways to make rails run more efficiently under such constraints. > > Are there articles/tips about this or do I need to look into this from > scratch? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >