Update: magnum-api use werkzeug to run WSGI application [1] and run with more than one workers.
There is no error when workers equals 1, and raise error when workers>1. I dig werkzeug little.
find werkzeug will launch new process for each request, that means it will try to connect the database for each request. That's not the right way to use oslo.db
workers = CONF.api.workers
if not workers:
workers = processutils.get_worker_count()
LOG.info('Server will handle each request in a new process up to'
' %s concurrent processes', workers)
serving.run_simple(host, port, app, processes=workers, ssl_context=_get_ssl_configs(use_ssl))
Update: magnum-api use werkzeug to run WSGI application [1] and run with more than one workers.
There is no error when workers equals 1, and raise error when workers>1. I dig werkzeug little.
find werkzeug will launch new process for each request, that means it will try to connect the database for each request. That's not the right way to use oslo.db
workers = CONF.api.workers get_worker_ count() info('Server will handle each request in a new process up to' run_simple( host, port, app, processes=workers,
ssl_context= _get_ssl_ configs( use_ssl) )
if not workers:
workers = processutils.
LOG.
' %s concurrent processes', workers)
serving.
[1]https:/ /github. com/openstack/ magnum/ blob/master/ magnum/ cmd/api. py