commit cbbd0dee61f939a15216bcf8f94d9d696ad03cc4 Author: Jonathan Rosser Date: Tue Feb 4 13:13:55 2020 +0000 Reduce number of processes on small systems Even the most modest 4C/8T system would run with the maximum 16 processes due to the calculation being VCPU*2. This patch makes it clearer that glance_api_threads is the number of physical CPU, and halves glance_wsgi_processes to physical CPU*2 for a hyperthreaded CPU. Change-Id: I71357a585a053d0b4e9316cc69c681caee2259da diff --git a/defaults/main.yml b/defaults/main.yml index ac2d4b2..b175bfa 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -187,7 +187,7 @@ glance_cors_allowed_origin: "{{ (glance_show_multiple_locations | bool) | ternar ## Cap the maximum number of threads / workers when a user value is unspecified. glance_api_threads_max: 16 -glance_api_threads: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | max, glance_api_threads_max] | min }}" +glance_api_threads: "{{ [[(ansible_processor_vcpus//ansible_processor_threads_per_core)|default(1), 1] | max, glance_api_threads_max] | min }}" glance_task_executor: taskflow glance_digest_algorithm: sha256 @@ -276,7 +276,7 @@ glance_services: # Glance uWSGI settings glance_wsgi_processes_max: 16 -glance_wsgi_processes: "{{ [[ansible_processor_vcpus|default(1), 1] | max * 2, glance_wsgi_processes_max] | min }}" +glance_wsgi_processes: "{{ [[(ansible_processor_vcpus//ansible_processor_threads_per_core)|default(1), 1] | max * 2, glance_wsgi_processes_max] | min }}" glance_wsgi_threads: 1 ## Tunable overrides