Make the number of workers for account, container and object servers a multiplier of the number of CPUs, and default to a sensible setting per recommendations in http://docs.openstack.org/developer/swift/deployment_guide.html#general-service-tuning
This commit is contained in:
parent
77743f3db6
commit
ee219bdd38
@ -49,4 +49,9 @@ options:
|
||||
default: 6002
|
||||
type: int
|
||||
description: Listening port of the swift-account-server.
|
||||
|
||||
worker-multiplier:
|
||||
default: 1
|
||||
type: int
|
||||
description: |
|
||||
The CPU multiplier to use when configuring worker processes for the
|
||||
account, container and object server processes.
|
||||
|
@ -61,10 +61,13 @@ class SwiftStorageServerContext(OSContextGenerator):
|
||||
interfaces = []
|
||||
|
||||
def __call__(self):
|
||||
import psutil
|
||||
multiplier = config('worker-multiplier') or 1
|
||||
ctxt = {
|
||||
'local_ip': unit_private_ip(),
|
||||
'account_server_port': config('account-server-port'),
|
||||
'container_server_port': config('container-server-port'),
|
||||
'object_server_port': config('object-server-port'),
|
||||
'workers': psutil.NUM_CPUS * multiplier,
|
||||
}
|
||||
return ctxt
|
||||
|
@ -48,7 +48,7 @@ from charmhelpers.contrib.openstack import (
|
||||
|
||||
PACKAGES = [
|
||||
'swift', 'swift-account', 'swift-container', 'swift-object',
|
||||
'xfsprogs', 'gdisk', 'lvm2', 'python-jinja2',
|
||||
'xfsprogs', 'gdisk', 'lvm2', 'python-jinja2', 'python-psutil',
|
||||
]
|
||||
|
||||
TEMPLATES = 'templates/'
|
||||
|
@ -1,7 +1,7 @@
|
||||
[DEFAULT]
|
||||
bind_ip = 0.0.0.0
|
||||
bind_port = {{ account_server_port }}
|
||||
workers = 2
|
||||
workers = {{ workers }}
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = recon account-server
|
||||
|
@ -1,7 +1,7 @@
|
||||
[DEFAULT]
|
||||
bind_ip = 0.0.0.0
|
||||
bind_port = {{ container_server_port }}
|
||||
workers = 2
|
||||
workers = {{ workers }}
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = recon container-server
|
||||
|
@ -1,7 +1,7 @@
|
||||
[DEFAULT]
|
||||
bind_ip = 0.0.0.0
|
||||
bind_port = {{ object_server_port }}
|
||||
workers = 2
|
||||
workers = {{ workers }}
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = recon object-server
|
||||
|
Loading…
Reference in New Issue
Block a user