summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2014-09-16 17:25:33 -0500
committerDean Troyer <dtroyer@gmail.com>2014-09-19 09:06:21 -0500
commit05bd7b803d87bbdd1a6f11cfd278eec319c819ea (patch)
tree52a763035448ccc5668e52052b7b495a3e26da9f
parent7672ad1dbc00ec5ff80f3aa670404e413e86e506 (diff)
Set default API_WORKERS
Set the API_WORKERS default to control memory usage. Maximum is nproc / 2 and minimum is 2. * Also updates https://review.openstack.org/#/c/117517/ to remove the conditional test as API_WORKERS should always be set. * Update https://review.openstack.org/#/c/109058/ for ceilometer to use API_WORKERS The following reviews can move forward either as-is or with minor tweaks: * Keystone: https://review.openstack.org/#/c/121384/ - remove the if check * Swift: https://review.openstack.org/#/c/121456/ - unabandon, the default to 1 is fine, or remove it to match the others. * Trove: https://review.openstack.org/#/c/121438/ - remove the if check https://etherpad.openstack.org/p/devstack-workers has the details Change-Id: Id28d72ebf01c88b7df301edf7d1dd7ec23fcd0d6
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Dean Troyer <dtroyer@gmail.com> Workflow+1: Dean Troyer <dtroyer@gmail.com> Submitted-by: Jenkins Submitted-at: Sat, 20 Sep 2014 03:46:26 +0000 Reviewed-on: https://review.openstack.org/122013 Project: openstack-dev/devstack Branch: refs/heads/master
-rw-r--r--lib/ceilometer2
-rw-r--r--lib/cinder4
-rw-r--r--lib/glance4
-rw-r--r--lib/nova8
-rw-r--r--stackrc5
5 files changed, 9 insertions, 14 deletions
diff --git a/lib/ceilometer b/lib/ceilometer
index a71643a..b9e42a2 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -154,7 +154,7 @@ function configure_ceilometer {
154 154
155 if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then 155 if [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then
156 iniset $CEILOMETER_CONF database connection `database_connection_url ceilometer` 156 iniset $CEILOMETER_CONF database connection `database_connection_url ceilometer`
157 iniset $CEILOMETER_CONF DEFAULT collector_workers $(( ($(nproc) + 1) / 2 )) 157 iniset $CEILOMETER_CONF DEFAULT collector_workers $API_WORKERS
158 else 158 else
159 iniset $CEILOMETER_CONF database connection mongodb://localhost:27017/ceilometer 159 iniset $CEILOMETER_CONF database connection mongodb://localhost:27017/ceilometer
160 configure_mongodb 160 configure_mongodb
diff --git a/lib/cinder b/lib/cinder
index 5c487a2..e767fa8 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -307,9 +307,7 @@ function configure_cinder {
307 iniset $CINDER_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME 307 iniset $CINDER_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME
308 iniset $CINDER_CONF keystone_authtoken admin_password $SERVICE_PASSWORD 308 iniset $CINDER_CONF keystone_authtoken admin_password $SERVICE_PASSWORD
309 309
310 if [ -n "$API_WORKERS" ]; then 310 iniset $CINDER_CONF DEFAULT osapi_volume_workers "$API_WORKERS"
311 iniset $CINDER_CONF DEFAULT osapi_volume_workers "$API_WORKERS"
312 fi
313} 311}
314 312
315# create_cinder_accounts() - Set up common required cinder accounts 313# create_cinder_accounts() - Set up common required cinder accounts
diff --git a/lib/glance b/lib/glance
index d6d12ca..054a7af 100644
--- a/lib/glance
+++ b/lib/glance
@@ -138,9 +138,7 @@ function configure_glance {
138 # sections. 138 # sections.
139 iniset $GLANCE_API_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/ 139 iniset $GLANCE_API_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
140 140
141 if [ -n "$API_WORKERS" ]; then 141 iniset $GLANCE_API_CONF DEFAULT workers "$API_WORKERS"
142 iniset $GLANCE_API_CONF DEFAULT workers "$API_WORKERS"
143 fi
144 142
145 # Store the images in swift if enabled. 143 # Store the images in swift if enabled.
146 if is_service_enabled s-proxy; then 144 if is_service_enabled s-proxy; then
diff --git a/lib/nova b/lib/nova
index 14d07b0..4864c0b 100644
--- a/lib/nova
+++ b/lib/nova
@@ -518,11 +518,9 @@ function create_nova_conf {
518 iniset_rpc_backend nova $NOVA_CONF DEFAULT 518 iniset_rpc_backend nova $NOVA_CONF DEFAULT
519 iniset $NOVA_CONF glance api_servers "$GLANCE_HOSTPORT" 519 iniset $NOVA_CONF glance api_servers "$GLANCE_HOSTPORT"
520 520
521 if [ -n "$API_WORKERS" ]; then 521 iniset $NOVA_CONF DEFAULT osci_compute_workers "$API_WORKERS"
522 iniset $NOVA_CONF DEFAULT osci_compute_workers "$API_WORKERS" 522 iniset $NOVA_CONF DEFAULT ec2_workers "$API_WORKERS"
523 iniset $NOVA_CONF DEFAULT ec2_workers "$API_WORKERS" 523 iniset $NOVA_CONF DEFAULT metadata_workers "$API_WORKERS"
524 iniset $NOVA_CONF DEFAULT metadata_workers "$API_WORKERS"
525 fi
526} 524}
527 525
528function init_nova_cells { 526function init_nova_cells {
diff --git a/stackrc b/stackrc
index 53c8579..0af9c4c 100644
--- a/stackrc
+++ b/stackrc
@@ -508,10 +508,11 @@ UNDO_REQUIREMENTS=${UNDO_REQUIREMENTS:-True}
508# Allow the use of an alternate protocol (such as https) for service endpoints 508# Allow the use of an alternate protocol (such as https) for service endpoints
509SERVICE_PROTOCOL=${SERVICE_PROTOCOL:-http} 509SERVICE_PROTOCOL=${SERVICE_PROTOCOL:-http}
510 510
511# Sets the maximum number of workers for various services and can restrict 511# Sets the maximum number of workers for most services to reduce
512# the memory used where there are a large number of CPUs present 512# the memory used where there are a large number of CPUs present
513# (the default number of workers for many services is the number of CPUs) 513# (the default number of workers for many services is the number of CPUs)
514# API_WORKERS=4 514# Also sets the minimum number of workers to 2.
515API_WORKERS=${API_WORKERS:=$(( ($(nproc)/2)<2 ? 2 : ($(nproc)/2) ))}
515 516
516# Local variables: 517# Local variables:
517# mode: shell-script 518# mode: shell-script