Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidekiq: Disables the cleanup recipe to avoid restarts every chef run #351

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions cookbooks/sidekiq/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,20 @@ sidekiq({
})
```

By default, the recipe will install Sidekiq on to a utility instance with the name `sidekiq`. If the utility name is `nil` or there is no utility instance matching the name given, Sidekiq will be installed on all application/solo instances.
By default, the recipe will install Sidekiq on utility instances with the name `sidekiq`. If the utility name is `nil` or there is no utility instance matching the name given, Sidekiq will be installed on all application/solo instances.

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`.

NOTE: If you change the `utility_name` setting, say, from `sidekiq_old` to `sidekiq_new`, the sidekiq monitrc file will not be cleaned up for you, and sidekiq will continue running on the `sidekiq_old` instances. You will have to do a manual cleanup on the `sidekiq_old` instances: stop sidekiq, remove the sidekiq .monitrc file in `/etc/monit.d/`, then run `sudo monit reload`.

The manual cleanup is the recommended approach for production environments. For development environments, we have provided the `sidekiq::cleanup` recipe. Just uncomment this line in `recipes/default.rb`:

```
# include_recipe "sidekiq::cleanup"
```

We do not recommend enabling it on production environments because when this is enabled, the sidekiq workers will be restarted every chef run.

## 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:
Expand All @@ -78,10 +88,10 @@ end
Sidekiq.configure_client do |config|
config.redis = { :url => "redis://<your_db_server>", :namespace => 'sidekiq' }
end
```
```

More information on setting the location of your server can be found at:
https://github.com/mperham/sidekiq/wiki/Advanced-Options
More information on setting the location of your server can be found at:
https://github.com/mperham/sidekiq/wiki/Advanced-Options

## Deploy Hooks

Expand Down
5 changes: 4 additions & 1 deletion cookbooks/sidekiq/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
# Recipe:: default
#

include_recipe "sidekiq::cleanup"
# Running sidekiq::cleanup is only recommended for development environments.
# Please see the README for more information.

#include_recipe "sidekiq::cleanup"
include_recipe "sidekiq::setup"