From 649c4ea1220af2a195b44d06ef9dcb914f00bd3d Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 7 Apr 2016 16:04:04 -0500 Subject: [PATCH] Change the default thread pool size In testing ironic it w/ mod-wsgi I've found that ironic does not pool connections to the messaging backend. This causes connection and intermitent issues within the ironic service. To mitigate these issues I've changed the ironic_wsgi_threads variable from using vcpus*2 to using vcpus//4 which will instruct the ironic process to only use 25% of the available vcpus rounded to the nearest whole number. A ternary operation was added to the default value to ensure the computed value is greater than or equal to 1. Error Example: XXX_ironic_conductor_container-XXX ironic-conductor: 2016-04-07 14:32:32.016 555 ERROR oslo.messaging._drivers.impl_rabbit [-] AMQP server on 172.19.102.219:5671 is unreachable: Basic.cancel: (0) 1. Trying again in 1 seconds. With a reduced thread count this error was resolved. My hosts have 48vCPUs resulting in 96 threads being used in the process. Change-Id: I0390f0d3f5d90f851f5373962c4b924d3ade72ff Signed-off-by: Kevin Carter --- defaults/main.yml | 3 ++- templates/ironic.conf.j2 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 17bd5745..1cb2faf2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -154,7 +154,8 @@ ironic_service_user_name: "ironic" # Apache settings ironic_wsgi_threads: 1 -ironic_wsgi_processes: "{{ ansible_processor_vcpus | default (1) * 2 }}" +_ironic_wsgi_processes: "{{ ansible_processor_vcpus | default(1) // 4 }}" +ironic_wsgi_processes: "{{ (_ironic_wsgi_processes | int > 1) | ternary(_ironic_wsgi_processes, 1) }}" ### OpenStack Services to integrate with diff --git a/templates/ironic.conf.j2 b/templates/ironic.conf.j2 index 44a302f5..57ebf111 100644 --- a/templates/ironic.conf.j2 +++ b/templates/ironic.conf.j2 @@ -1893,7 +1893,7 @@ rabbit_virtual_host={{ ironic_rabbitmq_vhost }} # Maximum number of connections to keep queued. (integer # value) -#pool_max_size=10 +pool_max_size = {{ ironic_wsgi_processes }} # Maximum number of connections to create above # `pool_max_size`. (integer value)