Add knob for changing cpu_allocation_ratio and turn it on by default

This commit is contained in:
James Page
2014-05-14 15:29:10 -04:00
parent e6f3702d0e
commit c8c798ff14
5 changed files with 29 additions and 5 deletions

View File

@@ -170,4 +170,11 @@ options:
The CPU multiplier to use when configuring worker processes for
Nova and Neutron. By default, the number of workers for each daemon
is set to the number of CPU's a service unit has.
cpu-allocation-ratio:
type: float
default: 16.0
description: |
The per physical core -> virtual core ratio to use in the Nova scheduler.
.
Increasing this value will increase instance density on compute nodes
at the expense of instance performance.

View File

@@ -213,3 +213,10 @@ class WorkerConfigContext(context.OSContextGenerator):
"workers": psutil.NUM_CPUS * multiplier
}
return ctxt
class NovaConfigContext(WorkerConfigContext):
def __call__(self):
ctxt = super(NovaConfigContext, self).__call__()
ctxt['cpu_allocation_ratio'] = config('cpu-allocation-ratio')
return ctxt

View File

@@ -103,14 +103,13 @@ BASE_RESOURCE_MAP = OrderedDict([
context.SubordinateConfigContext(
interface='nova-vmware',
service='nova',
config_file=NOVA_CONF,
),
config_file=NOVA_CONF),
context.SyslogContext(),
nova_cc_context.HAProxyContext(),
nova_cc_context.IdentityServiceContext(),
nova_cc_context.VolumeServiceContext(),
nova_cc_context.NeutronCCContext(),
nova_cc_context.WorkerConfigContext()],
nova_cc_context.NovaConfigContext()],
}),
(NOVA_API_PASTE, {
'services': [s for s in BASE_SERVICES if 'api' in s],
@@ -151,7 +150,7 @@ BASE_RESOURCE_MAP = OrderedDict([
nova_cc_context.NeutronCCContext(),
nova_cc_context.HAProxyContext(),
context.SyslogContext(),
nova_cc_context.WorkerConfigContext()],
nova_cc_context.NovaConfigContext()],
}),
(NEUTRON_DEFAULT, {
'services': ['neutron-server'],

View File

@@ -20,6 +20,13 @@ volumes_path=/var/lib/nova/volumes
enabled_apis=ec2,osapi_compute,metadata
auth_strategy=keystone
compute_driver=libvirt.LibvirtDriver
osapi_compute_workers = {{ workers }}
ec2_workers = {{ workers }}
scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter
cpu_allocation_ratio = {{ cpu_allocation_ratio }}
{% if keystone_ec2_url -%}
keystone_ec2_url = {{ keystone_ec2_url }}
{% endif -%}

View File

@@ -1,3 +1,4 @@
# icehouse
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
@@ -24,6 +25,9 @@ compute_driver=libvirt.LibvirtDriver
osapi_compute_workers = {{ workers }}
ec2_workers = {{ workers }}
scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter
cpu_allocation_ratio = {{ cpu_allocation_ratio }}
{% if keystone_ec2_url -%}
keystone_ec2_url = {{ keystone_ec2_url }}
{% endif -%}