octavia/releasenotes/notes/fix-housekeeping-db-performance-b0d0fcfcce696314.yaml
Carlos Goncalves be552d99a4 Fix performance of housekeeping DB clean up
The Housekeeping service grows in utilization of CPU as more amphorae
are created and/or marked as DELETED. The problem lays on the SELECT
statement constructed in get_all_deleted_expiring_amphora via the ORM --
it is joined eager loading all relationships.

The task does not need such amount of information, only the amphora ID.
The statement could be simplified by not loading any relationship or, at
most, lazy loading them.

This patch also fixes performance of cleaning up deleted and expired
load balancers. The code was doing multiple round-trips to the database
unecessarily:

1. retrieving all deleted LBs
2. for each LB, retrieving it again from DB to check expired date
3. delete LB

Step 1 and 2 are now condensed in get_all_deleted_expiring(), making it
a single round-trip.

Story: 2004665
Task: 28643

Change-Id: Iffc960c7c3a986328cfded1b4e408931ab0a7877
2019-02-19 16:36:02 +01:00

7 lines
210 B
YAML

---
fixes:
- |
Fixed a performance issue where the Housekeeping service could
significantly and incrementally utilize CPU as more amphorae and load
balancers are created and/or marked as DELETED.