From 4d8032ab62dc27206b07f4f167b6b324dc778565 Mon Sep 17 00:00:00 2001 From: "Kyle L. Henderson" Date: Thu, 19 Jan 2017 12:16:21 -0600 Subject: [PATCH] Cap the number of worker threads Users can configure the number of worker threads however when it's not specified the calculated number of workers can get too large on hosts with a large number of CPUs. Change-Id: I01af5ef83698231137b972b9a6d504d6f99eabaf --- defaults/main.yml | 4 ++++ releasenotes/notes/cap-workers-fc70b4f8586ba1a5.yaml | 6 ++++++ templates/neutron.conf.j2 | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/cap-workers-fc70b4f8586ba1a5.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 3d58aa8d..4e437807 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -411,6 +411,10 @@ neutron_quota_vip: 10 # If ``neutron_metadata_workers`` is unset the system will use half the number of available VCPUs to # compute the number of api workers to use. # neutron_metadata_workers: 16 + +## Cap the maximun number of threads / workers when a user value is unspecified. +neutron_api_threads_max: 16 + neutron_metadata_backlog: 4096 ## Auth diff --git a/releasenotes/notes/cap-workers-fc70b4f8586ba1a5.yaml b/releasenotes/notes/cap-workers-fc70b4f8586ba1a5.yaml new file mode 100644 index 00000000..6fc35e2d --- /dev/null +++ b/releasenotes/notes/cap-workers-fc70b4f8586ba1a5.yaml @@ -0,0 +1,6 @@ +--- +features: + - The number of worker threads for neutron will now be capped at 16 unless + a specific value is specified. Previously, the calculated number of workers + could get too high on systems with a large number of processors. This was + particularly evident on POWER systems. diff --git a/templates/neutron.conf.j2 b/templates/neutron.conf.j2 index 79ba9a20..f8a5e8e7 100644 --- a/templates/neutron.conf.j2 +++ b/templates/neutron.conf.j2 @@ -1,6 +1,6 @@ # {{ ansible_managed }} -{% set _api_threads = ansible_processor_vcpus|default(2) // 2 %} +{% set _api_threads = [ansible_processor_vcpus|default(2) // 2, neutron_api_threads_max] | min %} {% set api_threads = _api_threads if _api_threads > 0 else 1 %} # General, applies to all host groups