Limits engine workers for virtual deployments 23/14523/2
authorTim Rozet <trozet@redhat.com>
Mon, 23 May 2016 14:45:13 +0000 (10:45 -0400)
committerTim Rozet <trozet@redhat.com>
Mon, 23 May 2016 14:52:09 +0000 (10:52 -0400)
Heat uses sub-process forking for increasing number of workers to handle
tasks.  This patch limits number of workers in undercloud and overcloud
for virtual deployments to help battle resource contention.

Change-Id: I70edff708b7dcaf114b285046af3138a67167150
Signed-off-by: Tim Rozet <trozet@redhat.com>
build/undercloud.sh
build/virtual-environment.yaml [new file with mode: 0644]
ci/deploy.sh

index 65462ec..ed4f2b3 100755 (executable)
@@ -67,6 +67,7 @@ LIBGUESTFS_BACKEND=direct virt-customize \
     --run-command "yum update -y openwsman*" \
     --run-command "cp /usr/share/instack-undercloud/undercloud.conf.sample /home/stack/undercloud.conf && chown stack:stack /home/stack/undercloud.conf" \
     --upload ../opnfv-environment.yaml:/home/stack/ \
+    --upload ../virtual-environment.yaml:/home/stack/ \
     -a undercloud.qcow2
 
 popd > /dev/null
diff --git a/build/virtual-environment.yaml b/build/virtual-environment.yaml
new file mode 100644 (file)
index 0000000..6f1d051
--- /dev/null
@@ -0,0 +1,17 @@
+parameter_defaults:
+  controllerExtraConfig:
+  # In releases before Mitaka, HeatWorkers doesn't modify
+  # num_engine_workers, so handle via heat::config
+    heat::config::heat_config:
+      DEFAULT/num_engine_workers:
+        value: 1
+    heat::api_cloudwatch::enabled: false
+    heat::api_cfn::enabled: false
+  HeatWorkers: 1
+  CeilometerWorkers: 1
+  CinderWorkers: 1
+  GlanceWorkers: 1
+  KeystoneWorkers: 1
+  NeutronWorkers: 1
+  NovaWorkers: 1
+  SwiftWorkers: 1
index 5cde799..9cdd829 100755 (executable)
@@ -739,6 +739,11 @@ sleep 30
 sudo systemctl restart openstack-glance-api
 sudo systemctl restart openstack-nova-conductor
 sudo systemctl restart openstack-nova-compute
+
+sudo sed -i '/num_engine_workers/c\num_engine_workers = 2' /etc/heat/heat.conf
+sudo sed -i '/#workers\s=/c\workers = 2' /etc/heat/heat.conf
+sudo systemctl restart openstack-heat-engine
+sudo systemctl restart openstack-heat-api
 EOI
 # WORKAROUND: must restart the above services to fix sync problem with nova compute manager
 # TODO: revisit and file a bug if necessary. This should eventually be removed
@@ -834,6 +839,8 @@ function undercloud_prep_overcloud_deploy {
 
   if [[ ! "$virtual" == "TRUE" ]]; then
      DEPLOY_OPTIONS+=" --control-flavor control --compute-flavor compute"
+  else
+     DEPLOY_OPTIONS+=" -e virtual-environment.yaml"
   fi
 
   DEPLOY_OPTIONS+=" -e opnfv-environment.yaml"