The performance of volume index is low

Bug #1483165 reported by wangxiyuan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
wangxiyuan

Bug Description

Now, when get the volume without limit, cinder will get all volume information from db first. Then get the max limit from CONF and filter it. It will waste much time to do it.

For example, if cinder has more than ten thousand volumes and max limit is one thousand. Cinder will get the ten thousand ones, then filter it. The remaining nine thousand volume is useless but have already occupied memory and time.

So I think a better way is to get the one thousand volume directly from db.

offset could be passed to db layer as well. Do indexing only once in db in enough and efficient.

Here are some test data:

Env: There are 60,000 volumes items, 370,000 volume_metadata items and
240,000 volume_glance_metadata items in cinder db.

Old volume index will use nearly 10G memory.
The new one just use about 500M memory.

wangxiyuan (wangxiyuan)
Changed in cinder:
assignee: nobody → wangxiyuan (wangxiyuan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/211079

Changed in cinder:
status: New → In Progress
wangxiyuan (wangxiyuan)
description: updated
description: updated
Revision history for this message
John Griffith (john-griffith) wrote :

Thanks for the details, your proposal sems reasonable. I'm actually more alarmed at the metadata usage you're measuring.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/212126

Changed in cinder:
assignee: wangxiyuan (wangxiyuan) → Gorka Eguileor (gorka)
Changed in cinder:
assignee: Gorka Eguileor (gorka) → wangxiyuan (wangxiyuan)
Revision history for this message
Xing Yang (xing-yang) wrote :

Do we have two patches addressing the same problem? Can you two coordinate with each other please?:)

Changed in cinder:
milestone: none → liberty-3
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by wangxiyuan (<email address hidden>) on branch: master
Review: https://review.openstack.org/211079
Reason: https://review.openstack.org/212126 did the same thing, and looks better.

Revision history for this message
wangxiyuan (wangxiyuan) wrote :
Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.0
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.