diff --git a/nova/compute/manager.py b/nova/compute/manager.py index ee0db485421a..d6938a146d05 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -512,7 +512,8 @@ class ComputeManager(manager.Manager): self.scheduler_client = scheduler_client.SchedulerClient() self._resource_tracker_dict = {} self.instance_events = InstanceEvents() - self._sync_power_pool = eventlet.GreenPool() + self._sync_power_pool = eventlet.GreenPool( + size=CONF.sync_power_state_pool_size) self._syncs_in_progress = {} self.send_instance_updates = CONF.scheduler_tracks_instance_changes if CONF.max_concurrent_builds != 0: diff --git a/nova/conf/compute.py b/nova/conf/compute.py index c1ad0e7f60a9..880454a30e61 100644 --- a/nova/conf/compute.py +++ b/nova/conf/compute.py @@ -375,6 +375,15 @@ Possible values: * If value is 0, then one attempt is made. * Any negative value is treated as 0. * For any value > 0, total attempts are (value + 1) +"""), + cfg.IntOpt('sync_power_state_pool_size', + default=1000, + help=""" +Number of greenthreads available for use to sync power states. + +Possible values: + +* Any positive integer representing greenthreads count. """) ] diff --git a/releasenotes/notes/sync_power_state_pool_size-81d2d142bffa055b.yaml b/releasenotes/notes/sync_power_state_pool_size-81d2d142bffa055b.yaml new file mode 100644 index 000000000000..ce29759908cf --- /dev/null +++ b/releasenotes/notes/sync_power_state_pool_size-81d2d142bffa055b.yaml @@ -0,0 +1,10 @@ +--- +other: + - New configuration option sync_power_state_pool_size + has been added to set the number of greenthreads available + for use to sync power states. Default value (1000) matches + the previous implicit default value provided by Greenpool. + This option can be used to reduce the number of concurrent requests + made to the hypervisor or system with real instance power states + for performance reasons. +