Search code examples
ruby-on-railsamazon-web-servicesresqueamazon-elastic-beanstalk

How can I run Rails background jobs with Resque on AWS Elastic Beanstalk?


I am running my rails app on the AWS Elastic Beanstalk platform, which is running a single EC2 instance with Auto Scaling & Elastic Load Balancing.

I'm wondering how to run resque, delayed_job or sidekicq or some other solution for background jobs on Elastic Beanstalk.

What are the possible options for background jobs on Elastic Beanstalk?


Solution

  • Best way to start/stop/restart background jobs could be via init scripts for these tasks. You could have these init scripts triggered as services when instances are launched. More about Customizing ElasticBeanstalk containers for services here.

    Once done, you could freeze your init scripts by creating an AMI of your instance and then launching instances out of this custom AMI with auto-scaling.

    Hope this helps.