[mthaddon,r=james-page] Add configuration options for tuning worker thread counts.
This commit is contained in:
commit
a04de8cd91
20
config.yaml
20
config.yaml
@ -75,3 +75,23 @@ options:
|
|||||||
order for this charm to function correctly, the privacy extension must be
|
order for this charm to function correctly, the privacy extension must be
|
||||||
disabled and a non-temporary address must be configured/available on
|
disabled and a non-temporary address must be configured/available on
|
||||||
your network interface.
|
your network interface.
|
||||||
|
account-max-connections:
|
||||||
|
default: 2
|
||||||
|
type: int
|
||||||
|
description: |
|
||||||
|
Number of connections allowed to the account rsync stanza.
|
||||||
|
container-max-connections:
|
||||||
|
default: 2
|
||||||
|
type: int
|
||||||
|
description: |
|
||||||
|
Number of connections allowed to the container rsync stanza.
|
||||||
|
object-max-connections:
|
||||||
|
default: 2
|
||||||
|
type: int
|
||||||
|
description: |
|
||||||
|
Number of connections allowed to the object rsync stanza.
|
||||||
|
object-replicator-concurrency:
|
||||||
|
default: 1
|
||||||
|
type: int
|
||||||
|
description: |
|
||||||
|
Number of replication workers to spawn.
|
||||||
|
@ -79,5 +79,10 @@ class SwiftStorageServerContext(OSContextGenerator):
|
|||||||
'workers': str(psutil.NUM_CPUS * multiplier),
|
'workers': str(psutil.NUM_CPUS * multiplier),
|
||||||
'object_server_threads_per_disk': config(
|
'object_server_threads_per_disk': config(
|
||||||
'object-server-threads-per-disk'),
|
'object-server-threads-per-disk'),
|
||||||
|
'account_max_connections': config('account-max-connections'),
|
||||||
|
'container_max_connections': config('container-max-connections'),
|
||||||
|
'object_max_connections': config('object-max-connections'),
|
||||||
|
'object_replicator_concurrency': config(
|
||||||
|
'object-replicator-concurrency'),
|
||||||
}
|
}
|
||||||
return ctxt
|
return ctxt
|
||||||
|
@ -15,6 +15,7 @@ use = egg:swift#object
|
|||||||
threads_per_disk = {{ object_server_threads_per_disk }}
|
threads_per_disk = {{ object_server_threads_per_disk }}
|
||||||
|
|
||||||
[object-replicator]
|
[object-replicator]
|
||||||
|
concurrency = {{ object_replicator_concurrency }}
|
||||||
|
|
||||||
[object-updater]
|
[object-updater]
|
||||||
|
|
||||||
|
@ -5,19 +5,19 @@ pid file = /var/run/rsyncd.pid
|
|||||||
address = {{ local_ip }}
|
address = {{ local_ip }}
|
||||||
|
|
||||||
[account]
|
[account]
|
||||||
max connections = 2
|
max connections = {{ account_max_connections }}
|
||||||
path = /srv/node/
|
path = /srv/node/
|
||||||
read only = false
|
read only = false
|
||||||
lock file = /var/lock/account.lock
|
lock file = /var/lock/account.lock
|
||||||
|
|
||||||
[container]
|
[container]
|
||||||
max connections = 2
|
max connections = {{ container_max_connections }}
|
||||||
path = /srv/node/
|
path = /srv/node/
|
||||||
read only = false
|
read only = false
|
||||||
lock file = /var/lock/container.lock
|
lock file = /var/lock/container.lock
|
||||||
|
|
||||||
[object]
|
[object]
|
||||||
max connections = 2
|
max connections = {{ object_max_connections }}
|
||||||
path = /srv/node/
|
path = /srv/node/
|
||||||
read only = false
|
read only = false
|
||||||
lock file = /var/lock/object.lock
|
lock file = /var/lock/object.lock
|
||||||
|
@ -393,6 +393,9 @@ class SwiftStorageBasicDeployment(OpenStackAmuletDeployment):
|
|||||||
'use': 'egg:swift#object',
|
'use': 'egg:swift#object',
|
||||||
'threads_per_disk': '4'
|
'threads_per_disk': '4'
|
||||||
}
|
}
|
||||||
|
'object-replicator': {
|
||||||
|
'concurrency': '1'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for section, pairs in expected.iteritems():
|
for section, pairs in expected.iteritems():
|
||||||
|
@ -64,6 +64,10 @@ class SwiftStorageContextTests(CharmTestCase):
|
|||||||
self.test_config.set('container-server-port', '502')
|
self.test_config.set('container-server-port', '502')
|
||||||
self.test_config.set('object-server-threads-per-disk', '3')
|
self.test_config.set('object-server-threads-per-disk', '3')
|
||||||
self.test_config.set('worker-multiplier', '3')
|
self.test_config.set('worker-multiplier', '3')
|
||||||
|
self.test_config.set('object-replicator-concurrency', '3')
|
||||||
|
self.test_config.set('account-max-connections', '10')
|
||||||
|
self.test_config.set('container-max-connections', '10')
|
||||||
|
self.test_config.set('object-max-connections', '10')
|
||||||
num_workers = psutil.NUM_CPUS * 3
|
num_workers = psutil.NUM_CPUS * 3
|
||||||
ctxt = swift_context.SwiftStorageServerContext()
|
ctxt = swift_context.SwiftStorageServerContext()
|
||||||
result = ctxt()
|
result = ctxt()
|
||||||
@ -74,5 +78,9 @@ class SwiftStorageContextTests(CharmTestCase):
|
|||||||
'local_ip': '10.0.0.5',
|
'local_ip': '10.0.0.5',
|
||||||
'object_server_threads_per_disk': '3',
|
'object_server_threads_per_disk': '3',
|
||||||
'workers': str(num_workers),
|
'workers': str(num_workers),
|
||||||
|
'object_replicator_concurrency': '3',
|
||||||
|
'account_max_connections': '10',
|
||||||
|
'container_max_connections': '10',
|
||||||
|
'object_max_connections': '10',
|
||||||
}
|
}
|
||||||
self.assertEquals(ex, result)
|
self.assertEquals(ex, result)
|
||||||
|
Loading…
Reference in New Issue
Block a user