diff --git a/manifests/storage/all.pp b/manifests/storage/all.pp index e723e96c..58d4135a 100644 --- a/manifests/storage/all.pp +++ b/manifests/storage/all.pp @@ -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, } } diff --git a/releasenotes/notes/expose-worker-count-07bde2c47a7c0329.yaml b/releasenotes/notes/expose-worker-count-07bde2c47a7c0329.yaml new file mode 100644 index 00000000..5fea5253 --- /dev/null +++ b/releasenotes/notes/expose-worker-count-07bde2c47a7c0329.yaml @@ -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. diff --git a/spec/classes/swift_storage_all_spec.rb b/spec/classes/swift_storage_all_spec.rb index 3779a6f0..00c22259 100644 --- a/spec/classes/swift_storage_all_spec.rb +++ b/spec/classes/swift_storage_all_spec.rb @@ -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