diff options
author | Clint Byrum <clint@fewbar.com> | 2014-05-15 12:24:18 -0400 |
---|---|---|
committer | Clint Byrum <clint@fewbar.com> | 2014-05-15 12:24:18 -0400 |
commit | 56041687844c7c04bfcad974a07ac3ff35f99e5c (patch) | |
tree | a900e7eca157bceef2e3aef4dd1c1ce541e5fc08 /bin | |
parent | 0bb12320f5ce1c9fcabd0dc474aff6250b6cb397 (diff) | |
download | heat-56041687844c7c04bfcad974a07ac3ff35f99e5c.tar.gz |
Default engine workers to the number of CPUs
The engine is single-threaded and thus needs more workers to handle more
concurrent requests on a single machine.
Change-Id: I36117c3876f84a2ff7ba5576444fdbf7716cc69e
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/heat-engine | 7 |
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() |