diff --git a/cookbooks/sidekiq/readme.md b/cookbooks/sidekiq/readme.md index 5384c73a..5d66e56d 100644 --- a/cookbooks/sidekiq/readme.md +++ b/cookbooks/sidekiq/readme.md @@ -6,6 +6,20 @@ Sidekiq is a simple, efficient message processing for Ruby that uses threads to https://github.com/mperham/sidekiq +## Requirements + +Sidekiq requires that Redis be installed and assumes it is located at `localhost:6379`. To install redis, add the following to your gemfile: + +``` +gem 'redis' +``` + +Then to install it into your environment uncomment the following line in `main/recipes/default.rb`: + +``` +include_recipe "redis" +``` + ## Usage First ensure that you have Sidekiq working in your development environment by following the Sidekiq "Getting Started" guide: @@ -49,6 +63,23 @@ By default, the recipe will install Sidekiq on to a utility instance with the na If you wish to have more than one sidekiq utility instance, name the sidekiq utility instances as "sidekiq" and also set the `utility_name` to `sidekiq`. +## Multi Instance Deploys + +By default engineyard will install Redis to your DB instance and if you wish to keep it there rather than the preferred method of creating a utility instance you will need to tell Sidekiq where to find Redis. You can do this by adding a Sidekiq intializer in `config/initializers/sidekiq.rb` with the following information: + +``` +Sidekiq.configure_server do |config| + config.redis = { :url => "redis://", :namespace => 'sidekiq' } +end + +Sidekiq.configure_client do |config| + config.redis = { :url => "redis://", :namespace => 'sidekiq' } +end +``` + +More information on setting the location of your server can be found at: +https://github.com/mperham/sidekiq/wiki/Advanced-Options + ## Deploy Hooks You will need to add a deploy hook to restart Sidekiq during deploys. This is needed to ensure the Sidekiq workers are running the latest version of the application.