Remove erlang/rabbit thread pool calculation
Proper version of this calculation is implemented upstream - https://github.com/rabbitmq/rabbitmq-server/issues/151 And removed version of the code is actually harmful, as it's using physicalprocessorcount (i.e. number of CPU sockets) for calculations. So on a 2 CPU/48 thread system there it was 30 threads instead of 768 calculated upstream. I've decided that it's easier to completely remove this code instead of duplicating current formula in upstream and providing a way to override this value through hiera - just not worth a hassle. Change-Id: I415d446af0a822d2a5ce3478fd9db1dd0f13e115 Closes-Bug: 1573696
This commit is contained in:
parent
50eb9b76ec
commit
0c16cbc9a7
|
@ -2,8 +2,6 @@ notice('MODULAR: rabbitmq.pp')
|
|||
|
||||
$fuel_settings = parseyaml($astute_settings_yaml)
|
||||
|
||||
$thread_pool_calc = min(100,max(12*$physicalprocessorcount,30))
|
||||
|
||||
class { 'fuel::rabbitmq':
|
||||
astute_user => $::fuel_settings['astute']['user'],
|
||||
astute_password => $::fuel_settings['astute']['password'],
|
||||
|
@ -11,7 +9,7 @@ class { 'fuel::rabbitmq':
|
|||
mco_user => $::fuel_settings['mcollective']['user'],
|
||||
mco_password => $::fuel_settings['mcollective']['password'],
|
||||
env_config => {
|
||||
'RABBITMQ_SERVER_ERL_ARGS' => "+K true +A${thread_pool_calc} +P 1048576",
|
||||
'RABBITMQ_SERVER_ERL_ARGS' => "+K true +P 1048576",
|
||||
'ERL_EPMD_ADDRESS' => $::fuel_settings['ADMIN_NETWORK']['ipaddress'],
|
||||
'NODENAME' => "rabbit@${::hostname}",
|
||||
},
|
||||
|
|
|
@ -111,12 +111,10 @@ class osnailyfacter::rabbitmq::rabbitmq {
|
|||
}
|
||||
|
||||
$config_management_variables_merged = merge($config_management_variables_default, $config_management_variables)
|
||||
# NOTE(bogdando) to get the limit for threads, the max amount of worker processess will be doubled
|
||||
$thread_pool_calc = min($workers_max*2,max(12*$physicalprocessorcount,30))
|
||||
|
||||
$environment_variables_init = hiera('rabbit_environment_variables',
|
||||
{
|
||||
'SERVER_ERL_ARGS' => "\"+K true +A${thread_pool_calc} +P 1048576\"",
|
||||
'SERVER_ERL_ARGS' => "\"+K true +P 1048576\"",
|
||||
'ERL_EPMD_ADDRESS' => $epmd_bind_ip_address,
|
||||
'PID_FILE' => $pid_file,
|
||||
}
|
||||
|
|
|
@ -12,10 +12,6 @@ describe manifest do
|
|||
YAML.load facts[:astute_settings_yaml]
|
||||
end
|
||||
|
||||
let(:thread_pool_calc) do
|
||||
[[12 * facts[:physicalprocessorcount].to_i, 30].max, 100].min
|
||||
end
|
||||
|
||||
it 'should declare "fuel::rabbitmq" class correctly' do
|
||||
parameters = {
|
||||
:astute_user => fuel_settings['astute']['user'],
|
||||
|
@ -24,7 +20,7 @@ describe manifest do
|
|||
:mco_user => fuel_settings['mcollective']['user'],
|
||||
:mco_password => fuel_settings['mcollective']['password'],
|
||||
:env_config => {
|
||||
'RABBITMQ_SERVER_ERL_ARGS' => "+K true +A#{thread_pool_calc} +P 1048576",
|
||||
'RABBITMQ_SERVER_ERL_ARGS' => "+K true +P 1048576",
|
||||
'ERL_EPMD_ADDRESS' => fuel_settings['ADMIN_NETWORK']['ipaddress'],
|
||||
'NODENAME' => "rabbit@#{facts[:hostname]}",
|
||||
},
|
||||
|
|
|
@ -50,7 +50,6 @@ describe manifest do
|
|||
amqp_port = Noop.hiera('amqp_port', '5673')
|
||||
workers_max = Noop.hiera 'workers_max'
|
||||
debug = Noop.hiera('debug', false)
|
||||
threads_max = 2*workers_max.to_i
|
||||
rabbit_hash = Noop.hiera_structure 'rabbit'
|
||||
use_pacemaker = rabbit_hash.fetch(['pacemaker'], true)
|
||||
pid_file = rabbit_hash.fetch('pid_file', '/var/run/rabbitmq/p_pid')
|
||||
|
@ -98,11 +97,7 @@ describe manifest do
|
|||
end
|
||||
|
||||
it 'has correct SERVER_ERL_ARGS in environment_variables' do
|
||||
expect($environment_variables['SERVER_ERL_ARGS']).to eq "\"+K true +A#{threads_max} +P 1048576\""
|
||||
end
|
||||
|
||||
it 'has correct SERVER_ERL_ARGS in environment_variables on 4 CPU & 32G system' do
|
||||
expect($environment_variables['SERVER_ERL_ARGS']).to eq "\"+K true +A34 +P 1048576\""
|
||||
expect($environment_variables['SERVER_ERL_ARGS']).to eq "\"+K true +P 1048576\""
|
||||
end
|
||||
|
||||
it 'has correct ERL_EPMD_ADDRESS in environment_variables' do
|
||||
|
|
Loading…
Reference in New Issue