← All use cases Infra investigation

Why does the database keep spiking?

PRODE-287invest-api · RDSSeverity P2Confidence ~90%

Trigger

The CloudWatch alarm rds-cur8-cpu-utilization-high (eu-west-2) tripped four times in 24 hours — peaking at 99.2% CPU on a db.t3.large. Not a one-off; a pattern.

What the agent saw

Investigation

The admin liquidations search eager-loads fees, investments, withdrawals, and documents per row, and orders by requestedAt — and none of those foreign-key columns nor requestedAt are indexed. So every search runs five sequential scans on tables that grow with every payment, investment, and withdrawal. The 32-second responses then produced an impatient retry / clear / re-apply pattern that compounded into 88 requests.

Two earlier hypotheses were ruled out against the request samples: it wasn't a missing debounce (an Apply-Filters button gates refetch), and it wasn't a detail page hitting the search endpoint (every sampled request used seller filters, never an id).

The fix · #9598, #9603

Verification & outcome

The load source was pinned to a single query signature with hard evidence, then indexed away. Follow-ups noted: slim the list-view payload, route admin reads to the idle replica, and retune the alarm threshold (30% → 70%) that was paging on routine admin work.

Knowledge-graph node

Alarm RDS CPU high → root cause unindexed admin liquidations search → fixed by FK indexes + in-flight guard → affects RDS / admin liquidations