Merge "Add a config to tune the number of api workers"

This commit is contained in:
Jenkins 2016-05-30 23:49:46 +00:00 committed by Gerrit Code Review
commit 8ac9576d1f
2 changed files with 4 additions and 1 deletions

View File

@ -35,6 +35,9 @@ API_SERVICE_OPTS = [
"the service, this option should be False; note, you "
"will want to change public API endpoint to represent "
"SSL termination URL with 'public_endpoint' option.")),
cfg.IntOpt('workers',
help=_("Number of workers for higgins-api service. "
"The default will be the number of CPUs available.")),
]
CONF = cfg.CONF

View File

@ -70,7 +70,7 @@ class WSGIService(service.ServiceBase):
"""
self.name = name
self.app = app.setup_app()
self.workers = (processutils.get_worker_count())
self.workers = (CONF.api.workers or processutils.get_worker_count())
if self.workers and self.workers < 1:
raise exception.ConfigInvalid(
_("api_workers value of %d is invalid, "