Add support of multi-worker deployment of Sahara API.
Currently Sahara API uses one thread with wsgi application. This means that API can service only one request at a time. Some requests (e.g. cluster scale) require synchronous requests to Sahara engine (using message queue). This means that Sahara API will not be able to service other requests until full round trip finished.
Also, multi-threaded solution gives much more options for performance tuning. It could allow to utilize more server CPU power.
Most of OpenStack services support several workers for API.
The ideal solution for that would be migration to Pecan and WSME ( https://etherpad.openstack.org/havana-common-wsgi) with multi-threading support. Although this will require a lot of work and there is no much pressure to do that.
This spec suggests simple solution of specific problem without much refactoring of existing code.
So, the solution is: 1. Leave current wsgi implementation 2. Leave current socket handling 3. Run wsgi server in several threads/processes 4. Implement only children processes management, leave all existing code as is.
Children processes management will include:
Things that will NOT be included: 1. Config reload / API restart
Migrate to Pecan and WSME first.
Most OpenStack services use deprecated oslo wsgi module. It has tight connections with oslo services module.
So, there are three options here:
I propose going with the option 3. There is no much sense spending resources for code, that will be replaced anyway (we will definitely migrate to Pecan some day).
One more configuration parameter.
Manually. Probably CI could be changed to run different tests in different modes.
Need to be documented.