Comment 3 for bug 1701260

Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :

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))

[1]https://github.com/openstack/magnum/blob/master/magnum/cmd/api.py