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
7aa07c4506
commit
7fa632dfdf
|
@ -23,8 +23,6 @@ if $production == 'docker-build' {
|
|||
$bind_ip = $::fuel_settings['ADMIN_NETWORK']['ipaddress']
|
||||
}
|
||||
|
||||
$thread_pool_calc = min(100,max(12*$physicalprocessorcount,30))
|
||||
|
||||
class {'docker::container': }
|
||||
|
||||
user { "rabbitmq":
|
||||
|
@ -55,7 +53,7 @@ class { 'nailgun::rabbitmq':
|
|||
mco_vhost => $mco_vhost,
|
||||
stomp => $stomp,
|
||||
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' => $bind_ip,
|
||||
'NODENAME' => "rabbit@${::hostname}",
|
||||
},
|
||||
|
|
|
@ -98,12 +98,10 @@ if $queue_provider == 'rabbitmq' {
|
|||
'listener' => "[{port, 15672}, {ip,\"${management_bind_ip_address}\"}]",
|
||||
}
|
||||
)
|
||||
# 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,
|
||||
}
|
||||
|
|
|
@ -6,15 +6,9 @@ describe manifest do
|
|||
shared_examples 'catalog' do
|
||||
|
||||
workers_max = Noop.hiera 'workers_max'
|
||||
threads_max = 2*workers_max.to_i
|
||||
it 'has correct SERVER_ERL_ARGS in environment_variables' do
|
||||
environment_variables = Noop.resource_parameter_value self, 'class', 'rabbitmq', 'environment_variables'
|
||||
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
|
||||
environment_variables = Noop.resource_parameter_value self, 'class', 'rabbitmq', 'environment_variables'
|
||||
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