Merge "Add a config to tune the number of api workers"
This commit is contained in:
commit
8ac9576d1f
@ -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
|
||||
|
@ -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, "
|
||||
|
Loading…
x
Reference in New Issue
Block a user