From 5e4c9582f19ae54ff68d68c68ef7e37f1162faac Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Mon, 30 Nov 2020 14:01:40 +0200 Subject: [PATCH] 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. We devide amount of CPUs to number of threads for hyperthreaded CPUs Change-Id: Ie3c590d413b001ac9ccdb6522c9654b4372b5e10 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 2fad5525..50ebfbca 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -225,7 +225,7 @@ swift_oslomsg_notify_vhost: /swift # value at 16 if the swift proxy is in a container and user did not define # this variable. swift_proxy_server_workers_max: 16 -swift_proxy_server_workers_not_capped: "{{ [ansible_processor_vcpus|default(2) // 2, 1] | max }}" +swift_proxy_server_workers_not_capped: "{{ [(ansible_processor_vcpus//ansible_processor_threads_per_core)|default(1), 1] | max * 2 }}" swift_proxy_server_workers_capped: "{{ [swift_proxy_server_workers_max, swift_proxy_server_workers_not_capped|int] | min }}" swift_proxy_server_workers: "{{ (inventory_hostname == physical_host) | ternary(swift_proxy_server_workers_not_capped, swift_proxy_server_workers_capped) }}"