diff options
author | Harald Jensås <hjensas@redhat.com> | 2022-10-28 16:40:05 +0200 |
---|---|---|
committer | Harald Jensås <hjensas@redhat.com> | 2022-12-14 09:14:14 +0100 |
commit | 8b00932e485813f1ed6013de6c7b7e7f180491f8 (patch) | |
tree | 3413509752fe3896b32648105362bd6c0b6c8cf7 /ironic/common/boot_devices.py | |
parent | f96b258709dc4057e3034dda0a62e0d894466084 (diff) | |
download | ironic-8b00932e485813f1ed6013de6c7b7e7f180491f8.tar.gz |
Use association_proxy for ports node_uuid
This change adds 'node_uuid' to ironic.objects.port.Port
and adds a relationship using association_proxy in
models.Port. Using the association_proxy removes the need
to do the node lookup to populate node uuid for ports in
the api controller.
NOTE:
On port create a read is added to read the port from the
database, this ensures node_uuid is loaded and solves the
DetachedInstanceError which is otherwise raised.
Bumps Port object version to 1.11
With patch:
1. Returned 20000 ports in python 2.7768702507019043
seconds from the DB.
2. Took 0.433107852935791 seconds to iterate through
20000 port objects.
Ports table is roughly 12800000 bytes of JSON.
3. Took 5.662816762924194 seconds to return all 20000
ports via ports API call pattern.
Without patch:
1. Returned 20000 ports in python 1.0273635387420654
seconds from the DB.
2. Took 0.4772777557373047 seconds to iterate through
20000 port objects.
Ports table is roughly 12800000 bytes of JSON.
3. Took 147.8800814151764 seconds to return all 20000
ports via ports API call pattern.
Conclusion:
Test #1 plain dbapi.get_port_list() test is ~3 times
slower, but Test #3 doing the API call pattern test
is ~2500% better.
Story: 2007789
Task: 40035
Change-Id: Iff204b3056f3058f795f05dc1d240f494d60672a
Diffstat (limited to 'ironic/common/boot_devices.py')
0 files changed, 0 insertions, 0 deletions