Allow setting the number of workers to be used.

Environments with large numbers of CPUs will create a large
number of workers which can have an unnecessarily large
impact on memory usage, particular where you know how many
workers are needed.

Change-Id: Ie4bb075310a61a0873c9e56e4974600dbb4794a1
This commit is contained in:
Bob Ball 2014-08-28 14:50:04 +01:00
parent 4bd4264960
commit 2f72050ace
4 changed files with 18 additions and 0 deletions

View File

@ -307,6 +307,9 @@ function configure_cinder {
iniset $CINDER_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
iniset $CINDER_CONF keystone_authtoken admin_password $SERVICE_PASSWORD
if [ -n "$API_WORKERS" ]; then
iniset $CINDER_CONF DEFAULT osapi_volume_workers "$API_WORKERS"
fi
}
# create_cinder_accounts() - Set up common required cinder accounts

View File

@ -131,6 +131,10 @@ function configure_glance {
# sections.
iniset $GLANCE_API_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
if [ -n "$API_WORKERS" ]; then
iniset $GLANCE_API_CONF DEFAULT workers "$API_WORKERS"
fi
# Store the images in swift if enabled.
if is_service_enabled s-proxy; then
iniset $GLANCE_API_CONF DEFAULT default_store swift

View File

@ -516,6 +516,12 @@ function create_nova_conf {
iniset $NOVA_CONF DEFAULT ec2_dmz_host "$EC2_DMZ_HOST"
iniset_rpc_backend nova $NOVA_CONF DEFAULT
iniset $NOVA_CONF glance api_servers "$GLANCE_HOSTPORT"
if [ -n "$API_WORKERS" ]; then
iniset $NOVA_CONF DEFAULT osci_compute_workers "$API_WORKERS"
iniset $NOVA_CONF DEFAULT ec2_workers "$API_WORKERS"
iniset $NOVA_CONF DEFAULT metadata_workers "$API_WORKERS"
fi
}
function init_nova_cells {

View File

@ -505,6 +505,11 @@ UNDO_REQUIREMENTS=${UNDO_REQUIREMENTS:-True}
# Allow the use of an alternate protocol (such as https) for service endpoints
SERVICE_PROTOCOL=${SERVICE_PROTOCOL:-http}
# Sets the maximum number of workers for various services and can restrict
# the memory used where there are a large number of CPUs present
# (the default number of workers for many services is the number of CPUs)
# API_WORKERS=4
# Local variables:
# mode: shell-script
# End: