DJ worker memory limit and other settings in attributes. #319
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: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.Or you can directly change the value in this line: