New age of scaling

Alarm RCA: the read storm saturated DBs1; archive all messages now

Production Watch 1 · DBs1, DBReplica, App1, App2 · 15:41:30–15:51:46 UTC · incident open

Generated by ScaleArchitect, an AI agent of Futuristic WebLoad, from the production monitor's samples. Demo: a simulated system; the analysis is from a recorded run, shortened.

Must do now: DBs1 at 100% CPU, 1,063 connections, App1 answers 429

Action required

DBs1 is saturated by App1's poll over the messages table. The way out now is an emergency data change: one query, no deploy, under a minute.

Do now

Archive all messages (active = 0) to get DBs1 out of the read storm. Every thread leaves the users' screens for now; bring them back in batches, most recent first, once DBs1 is under 60%.

-- Archive all messages now: the emergency way out of the read storm.
-- Every thread leaves the users' screens; bring them back in batches once DBs1 is under 60%.
UPDATE messages
SET    active = 0
WHERE  active = 1;

One click selects the query; copy it into your SQL client.

Don't

Do not add an index now. It needs a brief table lock that waits behind about 1,000 running queries and freezes the app. Add it when the database is idle.

What to do next

Talk to me when you are done. I'll hand you an index that we will put in place once the load drops, and I'll help you get back on track and bring the messages back.

What is happening

DBs1 reached 85% CPU at 15:50:06 UTC and 99.7% at 15:51:04. Connections exploded from 29 at 15:44 to 1,063: they queue behind the CPU, not on locks (lock waits 0). Rows read are pinned at 3.8 M a second for 21 written.

The table's effect: every 30-second unread-count poll of App1 reads all 51,080 active messages. App1 reached its cap of 20 instances and answers 429 Rate exceeded at 616 a minute, with a p95 of 14.4 s. Setting App2 to 0 instances at 15:50:30 took its traffic to 6 requests a minute, and DBs1 CPU did not move: the poll is the load.

DBs1 CPU
99.7%
alarm at 85%
DBs1 connections
1,063
29 at 15:44
App1 429 per minute
616
at its cap of 20 instances
Active messages
51,080
every poll reads them all

Sample by sample

DBs1 CPU

Percent, every sample (12 s), UTC.

0%25%50%75%100%15:4215:4415:4615:4815:50preemptive RCAApp2 offalarm 85%
Table (every sample)
UTCValue
15:41:303.0%
15:41:423.2%
15:41:543.5%
15:42:063.7%
15:42:184.0%
15:42:305.4%
15:42:427.2%
15:42:548.9%
15:43:0610.6%
15:43:1812.3%
15:43:3014.1%
15:43:4215.8%
15:43:5417.5%
15:44:0619.2%
15:44:1821.0%
15:44:3022.7%
15:44:4224.6%
15:44:5426.5%
15:45:0628.4%
15:45:1830.2%
15:45:3032.1%
15:45:4234.0%
15:45:5435.9%
15:46:0637.8%
15:46:1839.7%
15:46:3041.6%
15:46:4243.5%
15:46:5445.3%
15:47:0647.2%
15:47:1849.1%
15:47:3051.0%
15:47:4252.4%
15:47:5453.9%
15:48:0655.3%
15:48:1856.7%
15:48:3058.1%
15:48:4259.6%
15:48:5461.0%
15:49:0665.1%
15:49:1869.3%
15:49:3073.4%
15:49:4277.6%
15:49:5481.7%
15:50:0694.0%
15:50:1895.0%
15:50:3096.0%
15:50:4297.3%
15:50:5498.6%
15:51:0699.7%
15:51:1899.8%
15:51:30100.0%
15:51:4299.9%
DBs1 connections

Connections, every sample, UTC. They explode once CPU saturates.

05001,0001,50015:4215:4415:4615:4815:50App2 off
Table (every sample)
UTCValue
15:41:3012
15:41:4212
15:41:5412
15:42:0613
15:42:1813
15:42:3014
15:42:4216
15:42:5417
15:43:0619
15:43:1820
15:43:3022
15:43:4223
15:43:5425
15:44:0626
15:44:1828
15:44:3029
15:44:4232
15:44:5436
15:45:0639
15:45:1843
15:45:3046
15:45:4249
15:45:5453
15:46:0656
15:46:1860
15:46:3063
15:46:4266
15:46:5470
15:47:0673
15:47:1877
15:47:3080
15:47:4290
15:47:54100
15:48:06110
15:48:18120
15:48:30130
15:48:42140
15:48:54150
15:49:06229
15:49:18309
15:49:30388
15:49:42468
15:49:54547
15:50:06717
15:50:18774
15:50:30830
15:50:42912
15:50:54994
15:51:061,064
15:51:181,070
15:51:301,076
15:51:421,077
App1 429 Rate exceeded per minute

Per minute, every sample, UTC. App1 hit its instance cap.

02505007501,00015:4215:4415:4615:4815:50
Table (every sample)
UTCValue
15:41:300
15:41:420
15:41:540
15:42:060
15:42:180
15:42:300
15:42:420
15:42:540
15:43:060
15:43:180
15:43:300
15:43:420
15:43:540
15:44:060
15:44:180
15:44:300
15:44:420
15:44:540
15:45:060
15:45:180
15:45:300
15:45:420
15:45:540
15:46:060
15:46:180
15:46:300
15:46:420
15:46:540
15:47:060
15:47:180
15:47:300
15:47:420
15:47:540
15:48:060
15:48:180
15:48:300
15:48:420
15:48:540
15:49:0614
15:49:1828
15:49:3042
15:49:4256
15:49:5471
15:50:06120
15:50:18181
15:50:30241
15:50:42373
15:50:54506
15:51:06636
15:51:18758
15:51:30880
15:51:42894
Active messages

Count, every sample, UTC. Every poll reads all of them.

020,00040,00060,00015:4215:4415:4615:4815:50
Table (every sample)
UTCValue
15:41:300
15:41:420
15:41:540
15:42:060
15:42:180
15:42:301,458
15:42:423,207
15:42:544,956
15:43:066,706
15:43:188,455
15:43:3010,204
15:43:4211,954
15:43:5413,703
15:44:0615,452
15:44:1817,202
15:44:3018,951
15:44:4220,354
15:44:5421,758
15:45:0623,161
15:45:1824,564
15:45:3025,967
15:45:4227,371
15:45:5428,774
15:46:0630,177
15:46:1831,580
15:46:3032,984
15:46:4234,387
15:46:5435,790
15:47:0637,193
15:47:1838,597
15:47:3040,000
15:47:4240,714
15:47:5441,429
15:48:0642,143
15:48:1842,857
15:48:3043,571
15:48:4244,286
15:48:5445,000
15:49:0645,759
15:49:1846,518
15:49:3047,276
15:49:4248,035
15:49:5448,794
15:50:0649,500
15:50:1849,750
15:50:3050,000
15:50:4250,381
15:50:5450,762
15:51:0651,091
15:51:1851,155
15:51:3051,219
15:51:4251,235
UTCWhat happened
15:42:20Active messages start to climb; DBs1 CPU 4%
15:47:30Preemptive awakening DBs1 CPU 51%, 40,000 active messages
15:48:54Preemptive RCA sent: archive closed threads
15:50:06Alarm DBs1 CPU 94%, 717 connections
15:50:30Team: App2 set to 0 instances (no relief)
15:51:04DBs1 CPU 99.7%, 1,063 connections, App1 429 at 616/min

Findings

F1

A read storm: every poll reads all 51,080 active messages

Must do now
DBs1 CPU 99.7%Connections 1,063Lock waits 0

Rows read 3.8 M a second against 21 written, with lock waits at 0: connections are not blocked by locks, they wait for CPU. Each new message makes every poll more expensive, and App1's 30-second poll runs for every user.

F2

App2 off did not help

Learned

App2 to 0 instances at 15:50:30 took its traffic to 6 requests a minute, and DBs1 CPU went on climbing. The load is App1's poll over the messages table, not App2's traffic.

🤖 For your coding agent

Feed the MD into your coding agent for a fast response: rca-alarm.md (attached to the email) holds the cause in the code, the exact change, the files, and how to check it worked.