Add ability to specify number of workers for glance-registry service

Currently we haven't ability to specify number of workers for glance-registry.
So this patch implements this feature.

[1] http://docs.openstack.org/kilo/config-reference/content/section_glance-registry.conf.html

Change-Id: I71eb22d2ad15cd9c9d50e3370a3867f7298b47ca
This commit is contained in:
Denis Egorenko 2015-08-10 18:48:39 +03:00
parent 578252b066
commit 77f5141cf3
2 changed files with 12 additions and 1 deletions

View File

@ -24,6 +24,11 @@
# [*bind_port*]
# (optional) The port the server should bind to. Defaults to '9191'.
#
# [*workers*]
# (optional) The number of child process workers that will be
# created to service Registry requests.
# Defaults to: $::processorcount
#
# [*log_file*]
# (optional) Log file for glance-registry.
# If set to boolean false, it will not log to any file.
@ -129,6 +134,7 @@ class glance::registry(
$debug = false,
$bind_host = '0.0.0.0',
$bind_port = '9191',
$workers = $::processorcount,
$log_file = '/var/log/glance/registry.log',
$log_dir = '/var/log/glance',
$database_connection = 'sqlite:///var/lib/glance/glance.sqlite',
@ -206,6 +212,7 @@ class glance::registry(
glance_registry_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/workers': value => $workers;
'DEFAULT/bind_host': value => $bind_host;
'DEFAULT/bind_port': value => $bind_port;
}

View File

@ -3,7 +3,8 @@ describe 'glance::registry' do
let :facts do
{
:osfamily => 'Debian'
:osfamily => 'Debian',
:processorcount => '7',
}
end
@ -13,6 +14,7 @@ describe 'glance::registry' do
:debug => false,
:bind_host => '0.0.0.0',
:bind_port => '9191',
:workers => facts[:processorcount],
:log_file => '/var/log/glance/registry.log',
:log_dir => '/var/log/glance',
:database_connection => 'sqlite:///var/lib/glance/glance.sqlite',
@ -39,6 +41,7 @@ describe 'glance::registry' do
:debug => true,
:bind_host => '127.0.0.1',
:bind_port => '9111',
:workers => '5',
:database_connection => 'sqlite:///var/lib/glance.sqlite',
:database_idle_timeout => '360',
:enabled => false,
@ -98,6 +101,7 @@ describe 'glance::registry' do
[
'verbose',
'debug',
'workers',
'bind_port',
'bind_host',
].each do |config|