Reviewed: https://review.opendev.org/666042 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ab7d923ae7ed4d7525649bc16ff012c1bedca0f5 Submitter: Zuul Branch: master
commit ab7d923ae7ed4d7525649bc16ff012c1bedca0f5 Author: Matt Riedemann <[email protected]> Date: Tue Jun 18 11:13:32 2019 -0400 Fix GET /servers/detail host_status performance regression Change I82b11b8866ac82b05eae04351605d52fa8b91453 moved the host_status extended server attribute processing from an extension to the main servers view builder. This, however, caused a regression in the detailed listing of servers because it didn't incorporate the caching mechanism used previously by the extension so now for each server with details when microversion 2.16 or greater is used (and the request passes the policy check), we get the host status per server even if we have multiple servers on the same host. This moves the host_status processing out of the show() method when listing servers with details and processes them in aggregate similar to security groups and attached volumes. One catch is the show() method handles instances from down cells for us so we have to handle that separately in the new host_status processing, but it's trivial (just don't get host_status for instances without a host field set). This reverts commit 0cecd2ac324dc9a20e7d60987b9ef6e5082c426d. Change-Id: I8278d4ea993ed1600919e34c9759600c8c7dbb41 Closes-Bug: #1830260 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1830260 Title: Inefficient host_status lookup when listing servers with details (regression) Status in OpenStack Compute (nova): Fix Released Status in OpenStack Compute (nova) stein series: Triaged Bug description: We have a performance regression since Stein [1] when listing servers with details concerning the host_status field. The code used to rely on this method [2] to cache the host status information per host when iterating over a list of instances but now it fetches it per host per instance in the view builder [3]. Granted by default policy this would only affect performance for an admin, but if I'm an admin listing 1000 servers across all tenants using "nova list --all-tenants" (which is going to use a microversion high enough to hit this) it could be a noticeable slow down compared to before Stein. [1] https://review.opendev.org/#/c/584590/ [2] https://github.com/openstack/nova/blob/c7e9e667426a6d88d396a59cb40d30763a3265f9/nova/compute/api.py#L4926 [3] https://github.com/openstack/nova/blob/c7e9e667426a6d88d396a59cb40d30763a3265f9/nova/api/openstack/compute/views/servers.py#L325 To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1830260/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

