Merge lp:~mthaddon/charms/trusty/swift-storage/connections-and-concurrency into lp:~openstack-charmers-archive/charms/trusty/swift-storage/next

Proposed by Tom Haddon
Status: Merged
Merged at revision: 46
Proposed branch: lp:~mthaddon/charms/trusty/swift-storage/connections-and-concurrency
Merge into: lp:~openstack-charmers-archive/charms/trusty/swift-storage/next
Diff against target: 120 lines (+40/-3)
6 files modified
config.yaml (+20/-0)
hooks/swift_storage_context.py (+5/-0)
templates/object-server.conf (+1/-0)
templates/rsyncd.conf (+3/-3)
tests/basic_deployment.py (+3/-0)
unit_tests/test_swift_storage_context.py (+8/-0)
To merge this branch: bzr merge lp:~mthaddon/charms/trusty/swift-storage/connections-and-concurrency
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+234445@code.launchpad.net

Description of the change

Add config options for max connections of the account, container and object rsync stanzas, and also add a config option for object replicator concurrency.

To post a comment you must log in.
46. By Tom Haddon

Explicitly set rsync config values for better testing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2014-06-19 08:40:58 +0000
3+++ config.yaml 2014-09-12 11:02:38 +0000
4@@ -63,3 +63,23 @@
5 to not use a per-disk thread pool. It is recommended to keep this value
6 small, as large values can result in high read latencies due to large
7 queue depths. A good starting point is 4 threads per disk.
8+ account-max-connections:
9+ default: 2
10+ type: int
11+ description: |
12+ Number of connections allowed to the account rsync stanza.
13+ container-max-connections:
14+ default: 2
15+ type: int
16+ description: |
17+ Number of connections allowed to the container rsync stanza.
18+ object-max-connections:
19+ default: 2
20+ type: int
21+ description: |
22+ Number of connections allowed to the object rsync stanza.
23+ object-replicator-concurrency:
24+ default: 1
25+ type: int
26+ description: |
27+ Number of replication workers to spawn.
28
29=== modified file 'hooks/swift_storage_context.py'
30--- hooks/swift_storage_context.py 2014-06-18 11:34:19 +0000
31+++ hooks/swift_storage_context.py 2014-09-12 11:02:38 +0000
32@@ -71,5 +71,10 @@
33 'workers': str(psutil.NUM_CPUS * multiplier),
34 'object_server_threads_per_disk': config(
35 'object-server-threads-per-disk'),
36+ 'account_max_connections': config('account-max-connections'),
37+ 'container_max_connections': config('container-max-connections'),
38+ 'object_max_connections': config('object-max-connections'),
39+ 'object_replicator_concurrency': config(
40+ 'object-replicator-concurrency'),
41 }
42 return ctxt
43
44=== modified file 'templates/object-server.conf'
45--- templates/object-server.conf 2014-06-18 10:48:24 +0000
46+++ templates/object-server.conf 2014-09-12 11:02:38 +0000
47@@ -15,6 +15,7 @@
48 threads_per_disk = {{ object_server_threads_per_disk }}
49
50 [object-replicator]
51+concurrency = {{ object_replicator_concurrency }}
52
53 [object-updater]
54
55
56=== modified file 'templates/rsyncd.conf'
57--- templates/rsyncd.conf 2013-07-19 19:52:45 +0000
58+++ templates/rsyncd.conf 2014-09-12 11:02:38 +0000
59@@ -5,19 +5,19 @@
60 address = {{ local_ip }}
61
62 [account]
63-max connections = 2
64+max connections = {{ account_max_connections }}
65 path = /srv/node/
66 read only = false
67 lock file = /var/lock/account.lock
68
69 [container]
70-max connections = 2
71+max connections = {{ container_max_connections }}
72 path = /srv/node/
73 read only = false
74 lock file = /var/lock/container.lock
75
76 [object]
77-max connections = 2
78+max connections = {{ object_max_connections }}
79 path = /srv/node/
80 read only = false
81 lock file = /var/lock/object.lock
82
83=== modified file 'tests/basic_deployment.py'
84--- tests/basic_deployment.py 2014-07-11 16:41:12 +0000
85+++ tests/basic_deployment.py 2014-09-12 11:02:38 +0000
86@@ -383,6 +383,9 @@
87 'use': 'egg:swift#object',
88 'threads_per_disk': '4'
89 }
90+ 'object-replicator': {
91+ 'concurrency': '1'
92+ }
93 }
94
95 for section, pairs in expected.iteritems():
96
97=== modified file 'unit_tests/test_swift_storage_context.py'
98--- unit_tests/test_swift_storage_context.py 2014-06-19 08:40:58 +0000
99+++ unit_tests/test_swift_storage_context.py 2014-09-12 11:02:38 +0000
100@@ -64,6 +64,10 @@
101 self.test_config.set('container-server-port', '502')
102 self.test_config.set('object-server-threads-per-disk', '3')
103 self.test_config.set('worker-multiplier', '3')
104+ self.test_config.set('object-replicator-concurrency', '3')
105+ self.test_config.set('account-max-connections', '10')
106+ self.test_config.set('container-max-connections', '10')
107+ self.test_config.set('object-max-connections', '10')
108 num_workers = psutil.NUM_CPUS * 3
109 ctxt = swift_context.SwiftStorageServerContext()
110 result = ctxt()
111@@ -74,5 +78,9 @@
112 'local_ip': '10.0.0.5',
113 'object_server_threads_per_disk': '3',
114 'workers': str(num_workers),
115+ 'object_replicator_concurrency': '3',
116+ 'account_max_connections': '10',
117+ 'container_max_connections': '10',
118+ 'object_max_connections': '10',
119 }
120 self.assertEquals(ex, result)

Subscribers

People subscribed via source and target branches