parallel volume-attachment requests might starve out nova-api for others
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
High
|
Lee Yarwood |
Bug Description
When doing volume-attachemnts, nova-api does an RPC-call (with a long_rpc_timeout) into nova-compute to reserve_
Having RPC-calls in nova-api, that can take a long time, will block the process handling the request. If a project does a lot of volume-attachments (e.g. for a k8s workload > 10 attachments per instance), this could starve out other users of nova-api by occupying all available processes.
When running nova-api with eventlet, a small number of processes can handle a lot of requests in parallel and some blocking rpc-calls don't matter too much.
When switching to uWSGI, the number of processes would have to be increased drastically to accommodate for that - unless it's possible to map those requests to threads and use a high number of threads instead.
What's the recommended way to run nova-api on uWSGI to handle this? Low number of processes with high number of threads to mimic eventlet?
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Lee Yarwood (lyarwood) |
So I think I can reproduce this in a basic devstack env with a simple 2 process uwsgi config and enable-threads = true:
$ cat /<email address hidden>
[Unit]
Description = Devstack <email address hidden>
[Service] tStatus = 100 bin/uwsgi --procname-prefix nova-api --ini /etc/nova/ nova-api- uwsgi.ini
RestartForceExi
NotifyAccess = all
Restart = always
KillMode = process
Type = notify
ExecReload = /usr/bin/kill -HUP $MAINPID
ExecStart = /usr/local/
User = stack
SyslogIdentifier = <email address hidden>
[Install]
WantedBy = multi-user.target
$ cat /etc/nova/ nova-api- uwsgi.ini
[uwsgi] uwsgi/nova- api-wsgi. socket kill_them_ all bin/nova- api-wsgi
chmod-socket = 666
socket = /var/run/
lazy-apps = true
add-header = Connection: close
buffer-size = 65535
hook-master-start = unix_signal:15 gracefully_
thunder-lock = true
plugins = http,python3
enable-threads = true
worker-reload-mercy = 90
exit-on-reload = false
die-on-term = true
master = true
processes = 2
wsgi-file = /usr/local/
$ for i in $(seq 1 9); do openstack volume create --size 1 test-$i ; done ------- ------- ------- ------- ------- -+----- ------- ------- ------- ------- -----+- ------- ------- +------ ------- ------- ------- -+ ------- ------- ------- ------- ------- -+----- ------- ------- ------- ------- -----+- ------- ------- +------ ------- ------- ------- -+ befd-4122- bc3d-d54e9b0daa ae | 589295a7- 14bf-40cb- 8f05-1b22544800 2e | attach_volume | 2021-06- 02T09:00: 10.000000 | a435-4d91- 854a-9308a19284 d3 | 589295a7- 14bf-40cb- 8f05-1b22544800 2e | attach_volume | 2021-06- 02T09:00: 10.000000 | 716a-4294- 90d9-33869192e9 61 | 589295a7- 14bf-40cb- 8f05-1b22544800 2e | attach_volume | 2021-06- 02T09:00: 03.000000 | e94d-446e- 890f-216cc8f8d6 c3 | 589295a7- 14bf-40cb- 8f05-1b22544800 2e | attach_volume | 2021-06- 02T09:00: 03.000000 | 113f-436f- 8fa8-4c2373b9d8 31 | 589295a7- 14bf-40cb- 8f05-1b22544800 2e | attach_volume | 2021-06- 02T08:59: 57.000000 | b80d-4230- 8cf4-9a979690e7 ff | 589295a7- 14bf-40cb- 8f05-1b22544800 2e | attach_volume | 2021-06- 02T08:59: 56.000000 | e4c7-4469- bd66-4880add4b2 df | 589295a7- 14bf-40cb- 8f05-1b22544800 2e | attach_volume | 2021-06-02T08:5...
$ for i in $(seq 1 9); do openstack server add volume test test-$i & done
[1] 888087
[2] 888088
[3] 888089
[4] 888090
[5] 888091
[6] 888092
[7] 888093
[8] 888094
[9] 888095
[5] Done openstack server add volume test test-$i
[2] Done openstack server add volume test test-$i
[4] Done openstack server add volume test test-$i
[8]- Done openstack server add volume test test-$i
[9]+ Done openstack server add volume test test-$i
[1] Done openstack server add volume test test-$i
[3] Done openstack server add volume test test-$i
[6]- Done openstack server add volume test test-$i
[7]+ Done openstack server add volume test test-$i
$ openstack server event list test
+------
| Request ID | Server ID | Action | Start Time |
+------
| req-df477597-
| req-17e8c4af-
| req-336f0d30-
| req-7b9d3b8a-
| req-a2e80b18-
| req-8d24416c-
| req-0d91f187-