Re: [resque] Re: Tricks to reduce memory consumption ?
- Jason Amster
- 2011-02-13 @ 22:33
For some of our apps we created new environments (e.g. production_workers)
and then removed a bunch of stuff that gets loaded, and select fewer
plugins and initializers:
config.frameworks *-=* [:action_controller, :action_view, :action_mailer,
config.plugins = [:acts_as_state_machine, :resque] #query_analyzer for dev
config.initializers = [:workers_only, :resque_pool]
Please notice the -= notation as we're asking the worker environments to
remove the queue to be loaded. We didn't see the need to load any of the
above frameworks, as our jobs didn't require them. YMMV.
Be careful to not remove a key library though, we have some dependencies
that were hidden, and got burned a few times. Keep an eye on the failures.
On Sun, Feb 13, 2011 at 12:48 PM, Thibaut Barrère <email@example.com
> Hi again,
> in case that's useful to someone else, I carried on with my first idea
> and came up with this (if you use Bundler like in Rails 3):
> It only takes one extra environment variable and a custom bundler
> group (:worker here).
> This saved me around 65mb on my 2-workers setup.
> -- Thibaut
Jason Amster | BeenVerified, Inc.
Chief Technology Officer
404 Park Avenue S., 11th Floor | New York, New York 10016
firstname.lastname@example.org | www.beenverified.com