Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Setting auto mode by default for worker_processes parameter #22

Closed
wants to merge 1 commit into from
Closed

Conversation

deimosfr
Copy link
Contributor

Hi,

It would be nice to set the auto mode if nothing is set as described in the official documentation (http://nginx.org/en/docs/ngx_core_module.html#worker_processes). If you don't want to use auto because it requires a certain version, you may use this instead:

worker_processes {{ nginx_workers_processes | default(ansible_processor_cores) }};

What do you think about it ?

@jdauphant
Copy link
Owner

Hi @deimosfr ,
Thanks for the pull request, it's a good idea but what's the difference with the actual setting ?

nginx_worker_processes: "{{ ansible_processor_vcpus }}" # in defaults/main.yml

Normally ansible_processor_vcpus is more accurate than ansible_processor_cores in case of multithreading. ( https://github.com/ansible/ansible/blob/215359084b0a246cf55b1220790cb3e601531bc9/lib/ansible/module_utils/facts.py#L638 )

@deimosfr
Copy link
Contributor Author

Sorry for the mistake I didn't catch this one ;-).

However, the 'auto' mode may be better. Didn't looked at the Nginx code yet to know which solution is the best as they are not very clear in the documentation.

@jdauphant
Copy link
Owner

No problem

@jdauphant jdauphant closed this Dec 14, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants