Listing images is slow if you have many images in a busy MAAS
Bug #2091001 reported by
Björn Tillenius
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Committed
|
High
|
Stamatis Katsaounis | ||
3.5 |
Fix Released
|
High
|
Stamatis Katsaounis |
Bug Description
If you have many images, like around 30, and also have a quite busy MAAS that produce a lot of entries in the events table, listing images will be slow, both in the UI and in the API.
The reason is that for each image, we get the last deployment time by looking at the events table. We only get the latest event for each image, but the SQL query fetches all the events that are referring to deployments of each image.
As an example, with around 30 images, it takes around 40 seconds to list the images using the boot-resources API endpoint, and postgres is using close to 100% CPU during that time.
This is with MAAS 3.5.1, but it should affect the upcoming 3.6.0 release as well.
Related branches
~skatsaounis/maas:backport-2091001
- MAAS Lander: Approve
- Stamatis Katsaounis: Approve
-
Diff: 89 lines (+52/-5)2 files modifiedsrc/maasserver/models/bootresource.py (+9/-4)
src/maasserver/models/tests/test_bootresource.py (+43/-1)
~skatsaounis/maas:lp-2091001
- MAAS Lander: Approve
- Jacopo Rota: Approve
-
Diff: 89 lines (+52/-5)2 files modifiedsrc/maasserver/models/bootresource.py (+9/-4)
src/maasserver/models/tests/test_bootresource.py (+43/-1)
description: | updated |
Changed in maas: | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Stamatis Katsaounis (skatsaounis) |
milestone: | none → 3.6.0 |
Changed in maas: | |
status: | In Progress → Fix Committed |
To post a comment you must log in.