Merge "[health_manager] Allow tuning individual threads"

This commit is contained in:
Zuul
2022-03-11 11:37:58 +00:00
committed by Gerrit Code Review
3 changed files with 38 additions and 11 deletions

View File

@@ -25,12 +25,17 @@
# (optional) The bind port for the health manager
# Defaults to $::os_service_default
#
# [*workers*]
# (optional) The number of workers health_manager spawns
# [*health_update_threads*]
# (optional) Number of processes for amphora health update
# Defaults to $::os_workers
#
# [*stats_update_threads*]
# (optional) Number of processes for amphora stats update
# Defaults to $::os_workers
#
# [*failover_threads*]
# (optional) The number of threads performing amphora failovers.
# Defaults to $::os_service_default
#
# [*heartbeat_timeout*]
# (optional) Interval, in seconds, to wait before failing over an amphora.
@@ -48,6 +53,12 @@
# (optional) Sets the value of the heartbeat recv buffer
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*workers*]
# (optional) The number of workers health_manager spawns
# Defaults to undef
#
class octavia::health_manager (
$heartbeat_key,
$manage_service = true,
@@ -55,13 +66,15 @@ class octavia::health_manager (
$package_ensure = 'present',
$ip = $::os_service_default,
$port = $::os_service_default,
$workers = $::os_workers,
$health_update_threads = $::os_workers,
$stats_update_threads = $::os_workers,
$failover_threads = $::os_service_default,
$heartbeat_timeout = $::os_service_default,
$health_check_interval = $::os_service_default,
$heartbeat_interval = $::os_service_default,
$sock_rlimit = $::os_service_default,
# DEPRECATED PARAMETERS
$workers = undef,
) inherits octavia::params {
include octavia::deps
@@ -91,12 +104,19 @@ class octavia::health_manager (
}
}
if $workers != undef {
warning('The octavia::health_manager::workers parameter is deprecated. \
Use health_update_threads and stats_update_threads instead')
}
$health_update_threads_real = pick($workers, $health_update_threads)
$stats_update_threads_real = pick($workers, $stats_update_threads)
octavia_config {
'health_manager/heartbeat_key' : value => $heartbeat_key;
'health_manager/bind_ip' : value => $ip;
'health_manager/bind_port' : value => $port;
'health_manager/health_update_threads' : value => $workers;
'health_manager/stats_update_threads' : value => $workers;
'health_manager/health_update_threads' : value => $health_update_threads_real;
'health_manager/stats_update_threads' : value => $stats_update_threads_real;
'health_manager/failover_threads' : value => $failover_threads;
'health_manager/heartbeat_timeout' : value => $heartbeat_timeout;
'health_manager/health_check_interval' : value => $health_check_interval;

View File

@@ -0,0 +1,6 @@
---
deprecations:
- |
The ``octavia::health_manager::workers`` parameter has been deprecated.
Use the ``health_update_threads`` parameter and
the ``stats_update_threads`` parameter instead.

View File

@@ -33,8 +33,8 @@ describe 'octavia::health_manager' do
})
end
it { is_expected.to contain_octavia_config('health_manager/heartbeat_key').with_value('abcdefghi') }
it { is_expected.to contain_octavia_config('health_manager/health_update_threads').with_value('2') }
it { is_expected.to contain_octavia_config('health_manager/stats_update_threads').with_value('2') }
it { is_expected.to contain_octavia_config('health_manager/health_update_threads').with_value('4') }
it { is_expected.to contain_octavia_config('health_manager/stats_update_threads').with_value('4') }
it { is_expected.to contain_octavia_config('health_manager/failover_threads').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('health_manager/heartbeat_timeout').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('health_manager/health_check_interval').with_value('<SERVICE DEFAULT>') }
@@ -100,7 +100,8 @@ describe 'octavia::health_manager' do
context 'configured with specific parameters' do
before do
params.merge!({
:workers => 8,
:health_update_threads => 8,
:stats_update_threads => 12,
:failover_threads => 10,
:heartbeat_timeout => 60,
:health_check_interval => 3,
@@ -109,7 +110,7 @@ describe 'octavia::health_manager' do
})
end
it { is_expected.to contain_octavia_config('health_manager/health_update_threads').with_value(8) }
it { is_expected.to contain_octavia_config('health_manager/stats_update_threads').with_value(8) }
it { is_expected.to contain_octavia_config('health_manager/stats_update_threads').with_value(12) }
it { is_expected.to contain_octavia_config('health_manager/failover_threads').with_value(10) }
it { is_expected.to contain_octavia_config('health_manager/heartbeat_timeout').with_value(60) }
it { is_expected.to contain_octavia_config('health_manager/health_check_interval').with_value(3) }
@@ -123,7 +124,7 @@ describe 'octavia::health_manager' do
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
facts.merge!(OSDefaults.get_facts({ :os_workers => 4 }))
end
let(:platform_params) do
case facts[:osfamily]