~alexlist/charms/trusty/swift-storage/nrpe-rebased

« back to all changes in this revision

Viewing changes to hooks/swift_storage_context.py

  • Committer: james.page at ubuntu
  • Date: 2014-06-19 08:40:58 UTC
  • mfrom: (29.1.3 swift-storage)
  • Revision ID: james.page@ubuntu.com-20140619084058-75sbvrd124npkav5
[mthaddon,r=james-page] Add configuration for worker and per disk thread pool sizes

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. Also, add in a tunable option for object server threads_per_disk and tune default to recommendations from http://docs.openstack.org/developer/swift/deployment_guide.html#object-server-configuration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    interfaces = []
62
62
 
63
63
    def __call__(self):
 
64
        import psutil
 
65
        multiplier = int(config('worker-multiplier')) or 1
64
66
        ctxt = {
65
67
            'local_ip': unit_private_ip(),
66
68
            'account_server_port': config('account-server-port'),
67
69
            'container_server_port': config('container-server-port'),
68
70
            'object_server_port': config('object-server-port'),
 
71
            'workers': str(psutil.NUM_CPUS * multiplier),
 
72
            'object_server_threads_per_disk': config(
 
73
                'object-server-threads-per-disk'),
69
74
        }
70
75
        return ctxt