summaryrefslogtreecommitdiff
path: root/bin/heat-engine
diff options
context:
space:
mode:
Diffstat (limited to 'bin/heat-engine')
-rwxr-xr-xbin/heat-engine7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/heat-engine b/bin/heat-engine
index fe83730e2..0fc0bad10 100755
--- a/bin/heat-engine
+++ b/bin/heat-engine
@@ -21,6 +21,7 @@ which then calls into this engine.
import eventlet
eventlet.monkey_patch()
+import multiprocessing
import os
import sys
@@ -61,7 +62,11 @@ if __name__ == '__main__':
from heat.engine import service as engine
+ num_workers = cfg.CONF.num_engine_workers
+ if num_workers == -1:
+ num_workers = multiprocessing.cpu_count()
+
srv = engine.EngineService(cfg.CONF.host, rpc_api.ENGINE_TOPIC)
- launcher = service.launch(srv, workers=cfg.CONF.num_engine_workers)
+ launcher = service.launch(srv, workers=num_workers)
notify.startup_notify(cfg.CONF.onready)
launcher.wait()