Slow volume attachment listings with many deleted attachments
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
In Progress
|
Undecided
|
Marcin Wilk |
Bug Description
This LP bug is supplementary to original, already fixed, LP#1952443 [1]. The 'volume_attachment' table by default doesn't contain necessary indexes to effectively list volume attachments. As a result full table scans happen burning resources and taking long time to return results. Especially on the environments with lots of attachments marked as 'deleted'.
Following data comes from the production database where top ten volumes have got tens of thousands attachment records:
select volume_id, count(id) from cinder.
+------
| volume_id | count(id) |
+------
| 11111111-
| 22222222-
| 33333333-
| 44444444-
| 55555555-
| 66666666-
| 77777777-
| 88888888-
| 99999999-
| 00000000-
+------
And following are timings for the 'openstack volume attachment list' command:
openstack volume attachment list --project my_project --os-volume-
...
+------
| URL | Seconds |
+------
| GET https:/
| POST https:/
| GET https:/
| GET https:/
| Total | 7.688208 |
+------
The list attachments cinder API took 7.3s
After creating following index:
create index volume_
The timings for the same command looks as follows:
+------
| URL | Seconds |
+------
| GET https:/
| POST https:/
| GET https:/
| GET https:/
| Total | 0.6192329999999999 |
+------
The list attachments cinder API now takes much less time: 0.239s.
These additional two indexes are also needed:
- Speed up attaching a volume:
create index volume_
- Speed up attaching a volume, backup service start, some volume drivers, and the cinder-manage backup update_backup_host cmd:
create index volume_
Changed in cinder: | |
assignee: | nobody → Marcin Wilk (wilkmarcin) |
description: | updated |
description: | updated |
Fix proposed to branch: master /review. opendev. org/c/openstack /cinder/ +/913754
Review: https:/