Server list in both dashboard and command line takes a long time with many images

Bug #2012979 reported by tom king
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned
OpenStack Dashboard (Horizon)
New
Undecided
Unassigned

Bug Description

First, please pardon me if this has already been dealt with in newer releases. Our OpenStack is Train.

Our environment has thousands of images including snapshots.

When listing instances, both by command line and in the dashboard, the instance list takes quite a while and apparently goes through all images in the background. Please see the attached text file for an example, a project with five instances taking over 21 seconds to list the instances.

In contrast, using '-n' in the command will list those same instances in less than a second. Of course, the dashboard has no such option.

If feasible, can Nova only pull the images related to the instances rather than pulling every single image in the Glance repository?

Revision history for this message
tom king (kingttx) wrote :
tags: added: performance
Revision history for this message
melanie witt (melwitt) wrote (last edit ):

This is unfortunately a known issue and is not an issue in Nova but rather is an issue related to the python-openstackclient.

There are a couple of CLI options that can be passed to improve performance:

  * --no-name-lookup (which you already found)

or

  * --name-lookup-one-by-one (this will lookup only related images as you mention)

I have long thought the second option should be the default behavior but in the past there was some pushback about changing it. It might be worth checking again whether the python-openstackclient project might be open to accepting such a change now. They use the following bug tracker:

  https://storyboard.openstack.org/#!/project/openstack/python-openstackclient

I'm going to mark this as Invalid for Nova and then add Horizon because maybe they could update their internal call to use one of the above options when they call openstackclient to improve the UX.

Update: It looks like Horizon might not be using OSC to do the server list ... so a different change might be needed.

I'll also check if python-novaclient could somehow be responsible for the slow image call and if so, I'll add python-novaclient to this bug and remove Horizon.

[1] https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/server.html#cmdoption-openstack-server-list-n
[2] https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/server.html#cmdoption-openstack-server-list-name-lookup-one-by-one

Changed in nova:
status: New → Invalid
Revision history for this message
melanie witt (melwitt) wrote :

I think I found where Horizon is pulling the entire image list:

https://github.com/openstack/horizon/blob/76650bbfa7ff3669bde8fdd71f370b66a6be900e/openstack_dashboard/dashboards/project/instances/views.py#L151-L158

To improve performance in an environment with a large number of images, a different approach will be needed.

Revision history for this message
tom king (kingttx) wrote :

"I have long thought the second option should be the default behavior but in the past there was some pushback about changing it."

I agree with you on this.

"To improve performance in an environment with a large number of images, a different approach will be needed."

Also agreed. If folks are divided on whether the current method should be kept or a more direct approach is better, perhaps this could be a configurable method, giving folks the choice to pick one over the other.

Thanks for pursuing this. Please let me know if you need more information.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.