Change worker defaults to ::os_workers

This patch changes the default worker count from ::processorcount to the
new ::os_workers fact. ::os_workers is based on the number of processors
(currently cpu/4) but is capped at a maximum of 8 worker processors.
This is a much more reasonable default in general and prevents excessive
resource consumption on systems with a large number of CPUs.

Change-Id: Ieb69b5a6a50d37b0a49a8c9e57275673d60b5f10
This commit is contained in:
Maksym Yatsenko 2016-10-07 14:55:23 +03:00 committed by Alex Schultz
parent 334eec2fd0
commit 8790f250f0
8 changed files with 16 additions and 10 deletions

View File

@ -43,7 +43,7 @@
#
# [*osapi_compute_workers*]
# (optional) Number of workers for OpenStack API service
# Defaults to $::processorcount
# Defaults to $::os_workers
#
# [*osapi_compute_listen_port*]
# (optional) The port on which the OpenStack API will listen.
@ -51,7 +51,7 @@
#
# [*metadata_workers*]
# (optional) Number of workers for metadata service
# Defaults to $::processorcount
# Defaults to $::os_workers
#
# [*instance_name_template*]
# (optional) Template string to be used to generate instance names
@ -247,8 +247,8 @@ class nova::api(
$metadata_listen_port = 8775,
$enabled_apis = ['osapi_compute', 'metadata'],
$use_forwarded_for = false,
$osapi_compute_workers = $::processorcount,
$metadata_workers = $::processorcount,
$osapi_compute_workers = $::os_workers,
$metadata_workers = $::os_workers,
$sync_db = true,
$sync_db_api = true,
$db_online_data_migrations = false,

View File

@ -0,0 +1,5 @@
---
other:
- Parameters that control the number of spawned child processes for
distributing processing have had their default value changed from
::processorcount to ::os_workers.

View File

@ -347,7 +347,7 @@ describe 'nova::api' do
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({ :processorcount => 5 }))
facts.merge!(OSDefaults.get_facts({ :os_workers => 5 }))
end
let (:platform_params) do

View File

@ -39,7 +39,6 @@ describe 'nova::compute::ironic' do
let (:facts) do
facts.merge!(OSDefaults.get_facts({
:fqdn => 'some.host.tld',
:processorcount => 2,
:concat_basedir => '/var/lib/puppet/concat'
}))
end

View File

@ -30,7 +30,7 @@ describe 'nova::db::postgresql_api' do
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts({
:processorcount => 8,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end

View File

@ -30,7 +30,7 @@ describe 'nova::db::postgresql' do
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts({
:processorcount => 8,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end

View File

@ -73,7 +73,9 @@ describe 'nova::db::sync_api' do
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts())
facts.merge(OSDefaults.get_facts({
:os_workers => 8,
}))
end
it_configures 'nova-dbsync-api'

View File

@ -77,7 +77,7 @@ describe 'nova::db::sync' do
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts({
:processorcount => 8,
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end