Resque Capistrano Deployment in Rails -
i have rails 3.2.20 app i'm introducing resque
environment background job mail , sms alerts. have setup in development , i'm point of preparing merge branch , push staging , production testing. have few questions.
1.) how memory need run resque in production (approximately). understand starting resque worker loads full environment. i'm bit tight on memory , don't want have issues. i'll using single resque worker our email/sms traffic light , don't mind queues being backed few seconds minute. know question vague, i'd feel memory footprint resque requires.
2.) have redis running need figure out how start resque worker on deployment kill existing resque worker. i've come following add cap after deploy action.
task :resque_restart run "kill $(ps aux | grep 'resque' | awk '{print $2}')" run "cd #{current_path}; bundle exec rake resque:work queue=*" end
i haven't tested capistrano 2 (which i'm using), have tested commands manually , first command kill resque rake tasks , second command starts worker queues enabled.
i'm not sure if best way go or not, i'd hear feedback on simple capistrano task wrote.
3.) best way monitor resque rake task. instance if crashes or catches signal terminate, how can have restarted app doesn't crash , assure worker rake task running?
thanks in advance advice or guidance can provide.
it depends on size of app. experience, single resque worker isn't larger app's footprint. however, if resque worker instantiate lot of large objects, size of resque instance grow quickly.
check out capistrano-resque gem. provides functionality you, plus more. :)
there several options this. lot of people have followed similar this post running resque in production , using god gem. personally, i've used process similar described in post using monit. monit can bit of pain set up, i'd recommend checking out god gem.
Comments
Post a Comment