This add chunk_size related parameters for proxy-server and object-server.

New parameters for proxy class are object_chunk_size and client_chunk_size,
and for storage class: network_chunk_size, disk_chunk_size and
auditor_disk_chunk_size.

Change-Id: If2bbc9cea1f6e0959fd67d2e004b607a8e40beee
This commit is contained in:
Simeon Gourlin 2019-11-19 17:59:02 +01:00
parent 433cd29da3
commit 14d1bda0b3
No known key found for this signature in database
GPG Key ID: 7EC9FFDBDFF0A280
5 changed files with 49 additions and 2 deletions

View File

@ -65,6 +65,14 @@
# (optional) If True, the proxy will log whenever it has to failover to a handoff node
# Defaults to true.
#
# [*object_chunk_size*]
# (optional) Chunk size to read from object servers.
# Default to 65536.
#
# [*client_chunk_size*]
# (optional) Chunk size to read from clients.
# Default to 65536.
#
# [*max_containers_per_account*]
# (optional) If set to a positive value, will limit container number per account.
# Default to 0.
@ -158,6 +166,8 @@ class swift::proxy(
$log_name = 'proxy-server',
$cors_allow_origin = undef,
$strict_cors_mode = true,
$object_chunk_size = 65536,
$client_chunk_size = 65536,
$max_containers_per_account = 0,
$max_containers_whitelist = $::os_service_default,
$read_affinity = undef,
@ -235,6 +245,8 @@ class swift::proxy(
'app:proxy-server/set log_level': value => $log_level;
'app:proxy-server/set log_address': value => $log_address;
'app:proxy-server/log_handoffs': value => $log_handoffs;
'app:proxy-server/object_chunk_size': value => $object_chunk_size;
'app:proxy-server/client_chunk_size': value => $client_chunk_size;
'app:proxy-server/allow_account_management': value => $allow_account_management;
'app:proxy-server/account_autocreate': value => $account_autocreate;
'app:proxy-server/max_containers_per_account': value => $max_containers_per_account;

View File

@ -143,6 +143,18 @@
# (optional) Prefix for data being sent to statsd.
# Defaults to ''
#
# [*network_chunk_size*]
# (optional) Size of chunks to read/write over the network.
# Defaults to 65536.
#
# [*disk_chunk_size*]
# (optional) Size of chunks to read/write to disk.
# Defaults to 65536.
#
# [*auditor_disk_chunk_size*]
# (optional) Object-auditor size of chunks to read/write to disk.
# Defaults to undef.
#
# [*splice*]
# (optional) Use splice for zero-copy object GETs. This requires Linux Kernel
# version 3.0 or greater.
@ -181,6 +193,9 @@ define swift::storage::server(
$log_statsd_default_sample_rate = '1.0',
$log_statsd_sample_rate_factor = '1.0',
$log_statsd_metric_prefix = '',
$network_chunk_size = 65536,
$disk_chunk_size = 65536,
$auditor_disk_chunk_size = undef,
$splice = false,
) {

View File

@ -0,0 +1,9 @@
---
features:
- |
On proxy class, added two new parameters object_chunk_size and
client_chunk_size, that can be used to configure chunk size to
read from object servers and from clients side.
On storage::server class, added three new parameters network_chunk_size,
disk_chunk_size and auditor_disk_chunk_size, that can be used to
configure chunk size to read/write over the network and to the disk.

View File

@ -63,6 +63,8 @@ describe 'swift::proxy' do
it { should contain_swift_proxy_config('app:proxy-server/set log_level').with_value('INFO') }
it { should contain_swift_proxy_config('app:proxy-server/set log_address').with_value('/dev/log') }
it { should contain_swift_proxy_config('app:proxy-server/log_handoffs').with_value('true') }
it { should contain_swift_proxy_config('app:proxy-server/object_chunk_size').with_value('65536') }
it { should contain_swift_proxy_config('app:proxy-server/client_chunk_size').with_value('65536') }
it { should contain_swift_proxy_config('app:proxy-server/allow_account_management').with_value('true') }
it { should contain_swift_proxy_config('app:proxy-server/account_autocreate').with_value('true') }
it { should contain_swift_proxy_config('app:proxy-server/max_containers_per_account').with_value(0) }
@ -106,6 +108,8 @@ describe 'swift::proxy' do
:account_autocreate => false,
:log_level => 'DEBUG',
:log_name => 'swift-proxy-server',
:object_chunk_size => '8192',
:client_chunk_size => '8192',
:max_containers_per_account => 10,
:max_containers_whitelist => 'project1,project2',
:read_affinity => 'r1z1=100, r1=200',
@ -136,6 +140,8 @@ describe 'swift::proxy' do
it { should contain_swift_proxy_config('app:proxy-server/set log_level').with_value('DEBUG') }
it { should contain_swift_proxy_config('app:proxy-server/set log_address').with_value('/dev/log') }
it { should contain_swift_proxy_config('app:proxy-server/log_handoffs').with_value('true') }
it { should contain_swift_proxy_config('app:proxy-server/object_chunk_size').with_value('8192') }
it { should contain_swift_proxy_config('app:proxy-server/client_chunk_size').with_value('8192') }
it { should contain_swift_proxy_config('app:proxy-server/allow_account_management').with_value('false') }
it { should contain_swift_proxy_config('app:proxy-server/account_autocreate').with_value('false') }
it { should contain_swift_proxy_config('app:proxy-server/max_containers_per_account').with_value(10) }

View File

@ -17,13 +17,15 @@ log_udp_host = <%= @log_udp_host -%>
log_udp_port = <%= @log_udp_port -%>
<% end %>
workers = <%= @workers %>
<%- if @statsd_enabled -%>
<% if @statsd_enabled -%>
log_statsd_host = <%=@log_statsd_host%>
log_statsd_port = <%=@log_statsd_port%>
log_statsd_default_sample_rate = <%=@log_statsd_default_sample_rate%>
log_statsd_sample_rate_factor = <%=@log_statsd_sample_rate_factor%>
log_statsd_metric_prefix = <%=@log_statsd_metric_prefix%>
<%- end -%>
<% end -%>
network_chunk_size = <%= @network_chunk_size%>
disk_chunk_size = <%= @disk_chunk_size%>
[pipeline:main]
pipeline = <%= @pipeline.to_a.join(' ') %>
@ -44,5 +46,8 @@ concurrency = <%= @replicator_concurrency %>
concurrency = <%= @updater_concurrency %>
[object-auditor]
<% if @auditor_disk_chunk_size -%>
disk_chunk_size = <%= @auditor_disk_chunk_size %>
<% end -%>
[object-reconstructor]