Merge "Expose account/container/object worker count"

This commit is contained in:
Jenkins 2017-08-31 09:19:25 +00:00 committed by Gerrit Code Review
commit 1e1c9fe275
3 changed files with 44 additions and 0 deletions

View File

@ -97,6 +97,18 @@
# (optional) Prefix for data being sent to statsd.
# Defaults to ''
#
# [*account_server_workers*]
# (optional) Number of account server workers.
# Defaults to undef.
#
# [*container_server_workers*]
# (optional) Number of container server workers.
# Defaults to undef.
#
# [*object_server_workers*]
# (optional) Number of account server workers.
# Defaults to undef.
#
class swift::storage::all(
$storage_local_net_ip,
$devices = '/srv/node',
@ -121,6 +133,9 @@ class swift::storage::all(
$log_statsd_default_sample_rate = '1.0',
$log_statsd_sample_rate_factor = '1.0',
$log_statsd_metric_prefix = '',
$account_server_workers = undef,
$container_server_workers = undef,
$object_server_workers = undef,
) {
include ::swift::deps
@ -164,6 +179,7 @@ class swift::storage::all(
log_requests => $log_requests,
incoming_chmod => $incoming_chmod,
outgoing_chmod => $outgoing_chmod,
workers => $account_server_workers,
}
swift::storage::server { $container_port:
@ -175,6 +191,7 @@ class swift::storage::all(
log_requests => $log_requests,
incoming_chmod => $incoming_chmod,
outgoing_chmod => $outgoing_chmod,
workers => $container_server_workers,
}
swift::storage::server { $object_port:
@ -185,5 +202,6 @@ class swift::storage::all(
log_requests => $log_requests,
incoming_chmod => $incoming_chmod,
outgoing_chmod => $outgoing_chmod,
workers => $object_server_workers,
}
}

View File

@ -0,0 +1,6 @@
---
features:
- |
Expose the account, container and object server worker count. This allows
operators to tune their settings depending on their needs. The current
default is kept unchanged.

View File

@ -200,4 +200,24 @@ describe 'swift::storage::all' do
end
end
end
describe "when specifying number of workers" do
let :params do
{
:storage_local_net_ip => '127.0.0.1',
:account_server_workers => '42',
:container_server_workers => '42',
:object_server_workers => '42',
}
end
{'object' => '6000', 'container' => '6001', 'account' => '6002'}.each do |type,name|
it "should define worker count in the #{type} config file" do
is_expected.to contain_concat_fragment("swift-#{type}-#{name}").with_content(
/workers = 42/
)
end
end
end
end