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

DJ worker memory limit and other settings in attributes. #319

Merged
merged 1 commit into from
Jan 4, 2017

Conversation

mikong
Copy link
Contributor

@mikong mikong commented Dec 29, 2016

Description of your patch

This change makes the DJ worker memory limit in the monit control file customizable through delayed_job4/attributes/default.rb. Other settings (worker_count and is_dj_instance) were moved from delayed_job4/recipes/default.rb to delayed_job4/attributes/default.rb.

How to Test

Enable the updated delayed_job4 recipe, and try changing the value of default['delayed_job4']['worker_memory'] in attributes/default.rb. Check that the memory limit in /etc/monit.d/delayed_job*.monitrc gets updated on Apply.

Also, try changing default['delayed_job4']['is_dj_instance'] to only apply to solo:

# comment out the rest of the condition
default['delayed_job4']['is_dj_instance'] = node[:instance_role] == "solo" #|| (node[:instance_role] == "util" && node[:name] !~ /^(mongodb|redis|memcache)/)

Then, if you try adding a utility instance to your environment, DJ should not get set up on the utility instance. Uncomment the rest of the condition to install DJ in utility instances. Try adding a utility instance that matches one of the names in the regex (mongodb, redis or memcache). DJ should not get set up on that utility instance. If you remove the name from the regex, and Apply, check that DJ is then setup.

To test the worker_count, you can try changing the worker_count value in the else condition in attributes/default.rb. The new worker count should get applied to your utility instances.

if node[:instance_role] == 'solo'
  worker_count = 1
else
  case node[:ec2][:instance_type]
  [...redacted...]
  else
    worker_count = 2 # change this
  end
end

Or you can directly change the value in this line:

default['delayed_job4']['worker_count'] = worker_count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants