From 080fd53ec4d013c8147578322c676568970cc4bc Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Fri, 7 Feb 2020 13:34:45 +0000 Subject: [PATCH] [OVN] Change the default metadata_workers to 2 Prior to this patch, the metadata_workers parameter defaults to $os_workers (calculated here [0]) but, even tho it's capped at 12 workers this number still redundant. There are a few differences of how the OVN metadata agent works compared with the OVS metadata agents: 1) The OVN metadata workers are deployed onto the compute nodes and not on the controllers/gateways as the OVS ones are. This means it's better distributed. 2) Even tho we could have multiple workers, the OVN SB IDL in the OVN metadata agents acquires a lock while listening to OVSDB events. Therefore, even tho we could have dozens of agents only one of them is listening to the events. 3) Instantiating IDLs means maintaining in-memory replicas of the OVSDB (or, the tables of that DB that is being watched). This puts a burden on OVSDBs to maintain all these replicas updated, reducing this number workers also reduces the burden on the OVSDBs. This patch is reducing the default number of OVN metadata agents to two (per compute). Two because that keeps it HA, in case the active agente dies the lock moves to the other one and the service will keep working. [0] https://github.com/openstack/puppet-openstacklib/blob/74e0f5a3170b09632ad4ede7e20d3ebeb4514586/lib/facter/os_workers.rb#L37 Change-Id: I6b9cc2aff14ce38a56c2757d9ad6c56898e27247 Signed-off-by: Lucas Alvares Gomes (cherry picked from commit 847f434140ee8435ee842801748a0deccdff8155) (cherry picked from commit 2ed6a1936ac71807d650cf26cfbcd9f4330331b6) --- manifests/agents/ovn_metadata.pp | 4 ++-- .../reduce-ovn-metadata-workers-6ed825307997f8b9.yaml | 11 +++++++++++ spec/classes/neutron_agents_ovn_metadata_spec.rb | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/reduce-ovn-metadata-workers-6ed825307997f8b9.yaml diff --git a/manifests/agents/ovn_metadata.pp b/manifests/agents/ovn_metadata.pp index 32e15c695..a1451c261 100644 --- a/manifests/agents/ovn_metadata.pp +++ b/manifests/agents/ovn_metadata.pp @@ -45,7 +45,7 @@ # (optional) Number of separate worker processes to spawn. Greater than 0 # launches that number of child processes as workers. The parent process # manages them. -# Defaults to: $::os_workers +# Defaults to: 2 # # [*metadata_backlog*] # (optional) Number of backlog requests to configure the metadata server socket with. @@ -103,7 +103,7 @@ class neutron::agents::ovn_metadata ( $metadata_host = $::os_service_default, $metadata_port = $::os_service_default, $metadata_protocol = $::os_service_default, - $metadata_workers = $::os_workers, + $metadata_workers = 2, $metadata_backlog = $::os_service_default, $metadata_insecure = $::os_service_default, $nova_client_cert = $::os_service_default, diff --git a/releasenotes/notes/reduce-ovn-metadata-workers-6ed825307997f8b9.yaml b/releasenotes/notes/reduce-ovn-metadata-workers-6ed825307997f8b9.yaml new file mode 100644 index 000000000..1df081d41 --- /dev/null +++ b/releasenotes/notes/reduce-ovn-metadata-workers-6ed825307997f8b9.yaml @@ -0,0 +1,11 @@ +--- +upgrade: + - | + Switched the default value of the ``metadata_workers`` configuration + option for the OVN metadata agents to 2 (from $::os_workers). While + the OVS metadata agents runs on the controllers/gateway nodes (and + defaults to $::os_workers) the OVN metadata agents are distributed + and runs on the compute nodes instead so, there's no point in running + dozen of them on each compute. Also, by reducing the number of workers + we also reduce the burden on the OVSDB that the OVN metadata agent + connects to making OVN more scalable. diff --git a/spec/classes/neutron_agents_ovn_metadata_spec.rb b/spec/classes/neutron_agents_ovn_metadata_spec.rb index e73536a89..20df54ff2 100644 --- a/spec/classes/neutron_agents_ovn_metadata_spec.rb +++ b/spec/classes/neutron_agents_ovn_metadata_spec.rb @@ -57,7 +57,7 @@ describe 'neutron::agents::ovn_metadata' do should contain_ovn_metadata_agent_config('DEFAULT/nova_metadata_host').with(:value => '') should contain_ovn_metadata_agent_config('DEFAULT/nova_metadata_port').with(:value => '') should contain_ovn_metadata_agent_config('DEFAULT/nova_metadata_protocol').with(:value => '') - should contain_ovn_metadata_agent_config('DEFAULT/metadata_workers').with(:value => facts[:os_workers]) + should contain_ovn_metadata_agent_config('DEFAULT/metadata_workers').with(:value => 2) should contain_ovn_metadata_agent_config('DEFAULT/metadata_backlog').with(:value => '') should contain_ovn_metadata_agent_config('DEFAULT/nova_metadata_insecure').with(:value => '') should contain_ovn_metadata_agent_config('DEFAULT/state_path').with(:value => params[:state_path])