Skip to content
About
Main content

Find the metastable band

Simulate a modelNeeds Python

Problem

A system has two stable states at the same load. It runs healthily until a trigger (a burst, a cache flush) pushes it into overload; then a sustaining effect keeps it there after the trigger is gone. A common sustaining effect is that work per request grows when the system is overloaded: retries, cache misses, that waste the work already done. If overloaded requests cost k times more, the overloaded system's effective capacity is C/k, so any arrival rate between C/k and C is stable in both states. Getting out needs the load cut below C/k, not just below C.

Show that a system can be stable in two states at the same . Use a with capacity C = 2,000 requests/s. Add a rule: when the queue is longer than a threshold, each request costs k = 3 times more work. Run the simulation at arrival rates of 500, 1,000, 1,500 and 1,900 requests/s. For each rate, run once from a healthy start and once after a 5-second burst of 6,000 requests/s. Then add the procedure from the text (cut the load well below C/k, wait, then ramp up) at λ = 1,000.

The question. At which arrival rates does the system stay degraded after a burst, and does shed-and-ramp bring it back?


Predict

At 1,000 requests a second, half the capacity, does the system recover after a burst?

Run it

  1. 1Install uv once. It fetches Python and the lab's packages for you.

    Terminal
    curl -LsSf https://astral.sh/uv/install.sh | sh
  2. 2Get the script. It is the whole lab: read it, then download it.

    find-the-metastable-band.py59 linesDownload
    View the code
    find-the-metastable-band.py
    # /// script
    # requires-python = ">=3.10"
    # ///
    # Copyright (c) 2026 Aayush Sharma · SPDX-License-Identifier: MIT
    # https://thedataengineering.com/lab-code/LICENSE.txt
    """Find the metastable band.
    
    A server of capacity C = 2,000 requests/s where, once the queue is longer
    than a threshold, every request costs k = 3 times the work (retries, cold
    caches). Arrival rates from 500 to 1,900/s, from a healthy start and after a
    5-second burst of 6,000/s; then the recovery procedure: shed load below C/k,
    wait, ramp back up.
    """
    import argparse, json
    
    p = argparse.ArgumentParser(description=__doc__.splitlines()[0])
    p.add_argument("--capacity", type=float, default=2000, help="C: requests per second of work capacity.")
    p.add_argument("--k", type=float, default=3, help="Cost multiplier once the queue is long.")
    p.add_argument("--threshold", type=float, default=1000, help="Queue length that switches to the expensive mode.")
    p.add_argument("--rates", type=lambda s: [float(v) for v in s.split(",")], default=[500, 1000, 1500, 1900], help="Arrival rates.")
    p.add_argument("--seconds", type=int, default=400, help="Simulated seconds.")
    p.add_argument("--json", help="Also write the results to this JSON file.")
    args = p.parse_args()
    C, k, DT = args.capacity, args.k, 0.01
    
    def run(lam, burst, shed=False):
        q, series, state = 0.0, [], {}
        for i in range(int(args.seconds / DT)):
            t = i * DT
            a = 6000 if burst and 10 <= t < 15 else lam
            if shed and t >= 20:                                                  # shed well below C/k until the queue drains, then ramp
                if state.get("ramp_at") is None:
                    if q < args.threshold / 2: state["ramp_at"] = t
                    else: a = min(a, C / k * 0.5)
                if state.get("ramp_at") is not None and t < state["ramp_at"] + 30:
                    a = min(a, C / k * 0.5 + (lam - C / k * 0.5) * (t - state["ramp_at"]) / 30)
            cost = k if q > args.threshold else 1.0
            served = min(q + a * DT, C / cost * DT)
            q = q + a * DT - served
            if i % 100 == 0: series.append({"t": round(t), "goodput": served / DT * (1 if cost == 1 else 1 / k), "queue": q})
        end = series[-1]
        return series, end["queue"] > args.threshold
    
    rows, states = [], []
    for lam in args.rates:
        for burst in (False, True):
            s, stuck = run(lam, burst)
            states.append({"rate": lam, "start": "after a burst" if burst else "healthy", "end_state": "degraded" if stuck else "healthy"})
            if lam == 1000: rows += [dict(r, run="after a burst" if burst else "healthy start") for r in s]
        print(f"lambda = {lam:>6.0f}: healthy start -> {states[-2]['end_state']:<9} after a burst -> {states[-1]['end_state']}")
    s, stuck = run(1000, True, shed=True)
    rows += [dict(r, run="after a burst, then shed and ramp") for r in s]
    print(f"lambda = 1000 after a burst, with shed-and-ramp: {'degraded' if stuck else 'healthy'}   (band: {C / k:.0f} < lambda < {C:.0f})")
    
    if args.json:
        with open(args.json, "w") as f:
            json.dump({"tables": {"goodput": rows, "states": states, "summary": [{"band_low": C / k, "band_high": C,
                       "shed_recovers": "no" if stuck else "yes"}]}}, f)
    
  3. 3Run it in the folder you saved it to, with the defaults first. Then change a knob from the table below and run it again.

    Terminal
    uv run find-the-metastable-band.py
    uv run find-the-metastable-band.py --help     # every knob
Knobs
Knob · defaultWhat it changes
--capacity2000 C: requests per second of work capacity.
--k3 Cost multiplier once the queue is long.
--threshold1000 Queue length that switches to the expensive mode.
--rates500, 1000, 1500, 1900 Arrival rates.
--seconds400 Simulated seconds.

Our run

Goodput over time at λ = 1,000Apple M2 · 8 cores · 8 GB
healthy startafter a burstafter a burst, then shed and ramp
Data table
Goodput over time at λ = 1,000
SecondseriesGoodput (requests/s)
0healthy start1,000
1healthy start1,000
2healthy start1,000
3healthy start1,000
4healthy start1,000
5healthy start1,000
6healthy start1,000
7healthy start1,000
8healthy start1,000
9healthy start1,000
10healthy start1,000
11healthy start1,000
12healthy start1,000
13healthy start1,000
14healthy start1,000
15healthy start1,000
16healthy start1,000
17healthy start1,000
18healthy start1,000
19healthy start1,000
20healthy start1,000
21healthy start1,000
22healthy start1,000
23healthy start1,000
24healthy start1,000
25healthy start1,000
26healthy start1,000
27healthy start1,000
28healthy start1,000
29healthy start1,000
30healthy start1,000
31healthy start1,000
32healthy start1,000
33healthy start1,000
34healthy start1,000
35healthy start1,000
36healthy start1,000
37healthy start1,000
38healthy start1,000
39healthy start1,000
40healthy start1,000
41healthy start1,000
42healthy start1,000
43healthy start1,000
44healthy start1,000
45healthy start1,000
46healthy start1,000
47healthy start1,000
48healthy start1,000
49healthy start1,000
50healthy start1,000
51healthy start1,000
52healthy start1,000
53healthy start1,000
54healthy start1,000
55healthy start1,000
56healthy start1,000
57healthy start1,000
58healthy start1,000
59healthy start1,000
60healthy start1,000
61healthy start1,000
62healthy start1,000
63healthy start1,000
64healthy start1,000
65healthy start1,000
66healthy start1,000
67healthy start1,000
68healthy start1,000
69healthy start1,000
70healthy start1,000
71healthy start1,000
72healthy start1,000
73healthy start1,000
74healthy start1,000
75healthy start1,000
76healthy start1,000
77healthy start1,000
78healthy start1,000
79healthy start1,000
80healthy start1,000
81healthy start1,000
82healthy start1,000
83healthy start1,000
84healthy start1,000
85healthy start1,000
86healthy start1,000
87healthy start1,000
88healthy start1,000
89healthy start1,000
90healthy start1,000
91healthy start1,000
92healthy start1,000
93healthy start1,000
94healthy start1,000
95healthy start1,000
96healthy start1,000
97healthy start1,000
98healthy start1,000
99healthy start1,000
100healthy start1,000
101healthy start1,000
102healthy start1,000
103healthy start1,000
104healthy start1,000
105healthy start1,000
106healthy start1,000
107healthy start1,000
108healthy start1,000
109healthy start1,000
110healthy start1,000
111healthy start1,000
112healthy start1,000
113healthy start1,000
114healthy start1,000
115healthy start1,000
116healthy start1,000
117healthy start1,000
118healthy start1,000
119healthy start1,000
120healthy start1,000
121healthy start1,000
122healthy start1,000
123healthy start1,000
124healthy start1,000
125healthy start1,000
126healthy start1,000
127healthy start1,000
128healthy start1,000
129healthy start1,000
130healthy start1,000
131healthy start1,000
132healthy start1,000
133healthy start1,000
134healthy start1,000
135healthy start1,000
136healthy start1,000
137healthy start1,000
138healthy start1,000
139healthy start1,000
140healthy start1,000
141healthy start1,000
142healthy start1,000
143healthy start1,000
144healthy start1,000
145healthy start1,000
146healthy start1,000
147healthy start1,000
148healthy start1,000
149healthy start1,000
150healthy start1,000
151healthy start1,000
152healthy start1,000
153healthy start1,000
154healthy start1,000
155healthy start1,000
156healthy start1,000
157healthy start1,000
158healthy start1,000
159healthy start1,000
160healthy start1,000
161healthy start1,000
162healthy start1,000
163healthy start1,000
164healthy start1,000
165healthy start1,000
166healthy start1,000
167healthy start1,000
168healthy start1,000
169healthy start1,000
170healthy start1,000
171healthy start1,000
172healthy start1,000
173healthy start1,000
174healthy start1,000
175healthy start1,000
176healthy start1,000
177healthy start1,000
178healthy start1,000
179healthy start1,000
180healthy start1,000
181healthy start1,000
182healthy start1,000
183healthy start1,000
184healthy start1,000
185healthy start1,000
186healthy start1,000
187healthy start1,000
188healthy start1,000
189healthy start1,000
190healthy start1,000
191healthy start1,000
192healthy start1,000
193healthy start1,000
194healthy start1,000
195healthy start1,000
196healthy start1,000
197healthy start1,000
198healthy start1,000
199healthy start1,000
200healthy start1,000
201healthy start1,000
202healthy start1,000
203healthy start1,000
204healthy start1,000
205healthy start1,000
206healthy start1,000
207healthy start1,000
208healthy start1,000
209healthy start1,000
210healthy start1,000
211healthy start1,000
212healthy start1,000
213healthy start1,000
214healthy start1,000
215healthy start1,000
216healthy start1,000
217healthy start1,000
218healthy start1,000
219healthy start1,000
220healthy start1,000
221healthy start1,000
222healthy start1,000
223healthy start1,000
224healthy start1,000
225healthy start1,000
226healthy start1,000
227healthy start1,000
228healthy start1,000
229healthy start1,000
230healthy start1,000
231healthy start1,000
232healthy start1,000
233healthy start1,000
234healthy start1,000
235healthy start1,000
236healthy start1,000
237healthy start1,000
238healthy start1,000
239healthy start1,000
240healthy start1,000
241healthy start1,000
242healthy start1,000
243healthy start1,000
244healthy start1,000
245healthy start1,000
246healthy start1,000
247healthy start1,000
248healthy start1,000
249healthy start1,000
250healthy start1,000
251healthy start1,000
252healthy start1,000
253healthy start1,000
254healthy start1,000
255healthy start1,000
256healthy start1,000
257healthy start1,000
258healthy start1,000
259healthy start1,000
260healthy start1,000
261healthy start1,000
262healthy start1,000
263healthy start1,000
264healthy start1,000
265healthy start1,000
266healthy start1,000
267healthy start1,000
268healthy start1,000
269healthy start1,000
270healthy start1,000
271healthy start1,000
272healthy start1,000
273healthy start1,000
274healthy start1,000
275healthy start1,000
276healthy start1,000
277healthy start1,000
278healthy start1,000
279healthy start1,000
280healthy start1,000
281healthy start1,000
282healthy start1,000
283healthy start1,000
284healthy start1,000
285healthy start1,000
286healthy start1,000
287healthy start1,000
288healthy start1,000
289healthy start1,000
290healthy start1,000
291healthy start1,000
292healthy start1,000
293healthy start1,000
294healthy start1,000
295healthy start1,000
296healthy start1,000
297healthy start1,000
298healthy start1,000
299healthy start1,000
300healthy start1,000
301healthy start1,000
302healthy start1,000
303healthy start1,000
304healthy start1,000
305healthy start1,000
306healthy start1,000
307healthy start1,000
308healthy start1,000
309healthy start1,000
310healthy start1,000
311healthy start1,000
312healthy start1,000
313healthy start1,000
314healthy start1,000
315healthy start1,000
316healthy start1,000
317healthy start1,000
318healthy start1,000
319healthy start1,000
320healthy start1,000
321healthy start1,000
322healthy start1,000
323healthy start1,000
324healthy start1,000
325healthy start1,000
326healthy start1,000
327healthy start1,000
328healthy start1,000
329healthy start1,000
330healthy start1,000
331healthy start1,000
332healthy start1,000
333healthy start1,000
334healthy start1,000
335healthy start1,000
336healthy start1,000
337healthy start1,000
338healthy start1,000
339healthy start1,000
340healthy start1,000
341healthy start1,000
342healthy start1,000
343healthy start1,000
344healthy start1,000
345healthy start1,000
346healthy start1,000
347healthy start1,000
348healthy start1,000
349healthy start1,000
350healthy start1,000
351healthy start1,000
352healthy start1,000
353healthy start1,000
354healthy start1,000
355healthy start1,000
356healthy start1,000
357healthy start1,000
358healthy start1,000
359healthy start1,000
360healthy start1,000
361healthy start1,000
362healthy start1,000
363healthy start1,000
364healthy start1,000
365healthy start1,000
366healthy start1,000
367healthy start1,000
368healthy start1,000
369healthy start1,000
370healthy start1,000
371healthy start1,000
372healthy start1,000
373healthy start1,000
374healthy start1,000
375healthy start1,000
376healthy start1,000
377healthy start1,000
378healthy start1,000
379healthy start1,000
380healthy start1,000
381healthy start1,000
382healthy start1,000
383healthy start1,000
384healthy start1,000
385healthy start1,000
386healthy start1,000
387healthy start1,000
388healthy start1,000
389healthy start1,000
390healthy start1,000
391healthy start1,000
392healthy start1,000
393healthy start1,000
394healthy start1,000
395healthy start1,000
396healthy start1,000
397healthy start1,000
398healthy start1,000
399healthy start1,000
0after a burst1,000
1after a burst1,000
2after a burst1,000
3after a burst1,000
4after a burst1,000
5after a burst1,000
6after a burst1,000
7after a burst1,000
8after a burst1,000
9after a burst1,000
10after a burst2,000
11after a burst222
12after a burst222
13after a burst222
14after a burst222
15after a burst222
16after a burst222
17after a burst222
18after a burst222
19after a burst222
20after a burst222
21after a burst222
22after a burst222
23after a burst222
24after a burst222
25after a burst222
26after a burst222
27after a burst222
28after a burst222
29after a burst222
30after a burst222
31after a burst222
32after a burst222
33after a burst222
34after a burst222
35after a burst222
36after a burst222
37after a burst222
38after a burst222
39after a burst222
40after a burst222
41after a burst222
42after a burst222
43after a burst222
44after a burst222
45after a burst222
46after a burst222
47after a burst222
48after a burst222
49after a burst222
50after a burst222
51after a burst222
52after a burst222
53after a burst222
54after a burst222
55after a burst222
56after a burst222
57after a burst222
58after a burst222
59after a burst222
60after a burst222
61after a burst222
62after a burst222
63after a burst222
64after a burst222
65after a burst222
66after a burst222
67after a burst222
68after a burst222
69after a burst222
70after a burst222
71after a burst222
72after a burst222
73after a burst222
74after a burst222
75after a burst222
76after a burst222
77after a burst222
78after a burst222
79after a burst222
80after a burst222
81after a burst222
82after a burst222
83after a burst222
84after a burst222
85after a burst222
86after a burst222
87after a burst222
88after a burst222
89after a burst222
90after a burst222
91after a burst222
92after a burst222
93after a burst222
94after a burst222
95after a burst222
96after a burst222
97after a burst222
98after a burst222
99after a burst222
100after a burst222
101after a burst222
102after a burst222
103after a burst222
104after a burst222
105after a burst222
106after a burst222
107after a burst222
108after a burst222
109after a burst222
110after a burst222
111after a burst222
112after a burst222
113after a burst222
114after a burst222
115after a burst222
116after a burst222
117after a burst222
118after a burst222
119after a burst222
120after a burst222
121after a burst222
122after a burst222
123after a burst222
124after a burst222
125after a burst222
126after a burst222
127after a burst222
128after a burst222
129after a burst222
130after a burst222
131after a burst222
132after a burst222
133after a burst222
134after a burst222
135after a burst222
136after a burst222
137after a burst222
138after a burst222
139after a burst222
140after a burst222
141after a burst222
142after a burst222
143after a burst222
144after a burst222
145after a burst222
146after a burst222
147after a burst222
148after a burst222
149after a burst222
150after a burst222
151after a burst222
152after a burst222
153after a burst222
154after a burst222
155after a burst222
156after a burst222
157after a burst222
158after a burst222
159after a burst222
160after a burst222
161after a burst222
162after a burst222
163after a burst222
164after a burst222
165after a burst222
166after a burst222
167after a burst222
168after a burst222
169after a burst222
170after a burst222
171after a burst222
172after a burst222
173after a burst222
174after a burst222
175after a burst222
176after a burst222
177after a burst222
178after a burst222
179after a burst222
180after a burst222
181after a burst222
182after a burst222
183after a burst222
184after a burst222
185after a burst222
186after a burst222
187after a burst222
188after a burst222
189after a burst222
190after a burst222
191after a burst222
192after a burst222
193after a burst222
194after a burst222
195after a burst222
196after a burst222
197after a burst222
198after a burst222
199after a burst222
200after a burst222
201after a burst222
202after a burst222
203after a burst222
204after a burst222
205after a burst222
206after a burst222
207after a burst222
208after a burst222
209after a burst222
210after a burst222
211after a burst222
212after a burst222
213after a burst222
214after a burst222
215after a burst222
216after a burst222
217after a burst222
218after a burst222
219after a burst222
220after a burst222
221after a burst222
222after a burst222
223after a burst222
224after a burst222
225after a burst222
226after a burst222
227after a burst222
228after a burst222
229after a burst222
230after a burst222
231after a burst222
232after a burst222
233after a burst222
234after a burst222
235after a burst222
236after a burst222
237after a burst222
238after a burst222
239after a burst222
240after a burst222
241after a burst222
242after a burst222
243after a burst222
244after a burst222
245after a burst222
246after a burst222
247after a burst222
248after a burst222
249after a burst222
250after a burst222
251after a burst222
252after a burst222
253after a burst222
254after a burst222
255after a burst222
256after a burst222
257after a burst222
258after a burst222
259after a burst222
260after a burst222
261after a burst222
262after a burst222
263after a burst222
264after a burst222
265after a burst222
266after a burst222
267after a burst222
268after a burst222
269after a burst222
270after a burst222
271after a burst222
272after a burst222
273after a burst222
274after a burst222
275after a burst222
276after a burst222
277after a burst222
278after a burst222
279after a burst222
280after a burst222
281after a burst222
282after a burst222
283after a burst222
284after a burst222
285after a burst222
286after a burst222
287after a burst222
288after a burst222
289after a burst222
290after a burst222
291after a burst222
292after a burst222
293after a burst222
294after a burst222
295after a burst222
296after a burst222
297after a burst222
298after a burst222
299after a burst222
300after a burst222
301after a burst222
302after a burst222
303after a burst222
304after a burst222
305after a burst222
306after a burst222
307after a burst222
308after a burst222
309after a burst222
310after a burst222
311after a burst222
312after a burst222
313after a burst222
314after a burst222
315after a burst222
316after a burst222
317after a burst222
318after a burst222
319after a burst222
320after a burst222
321after a burst222
322after a burst222
323after a burst222
324after a burst222
325after a burst222
326after a burst222
327after a burst222
328after a burst222
329after a burst222
330after a burst222
331after a burst222
332after a burst222
333after a burst222
334after a burst222
335after a burst222
336after a burst222
337after a burst222
338after a burst222
339after a burst222
340after a burst222
341after a burst222
342after a burst222
343after a burst222
344after a burst222
345after a burst222
346after a burst222
347after a burst222
348after a burst222
349after a burst222
350after a burst222
351after a burst222
352after a burst222
353after a burst222
354after a burst222
355after a burst222
356after a burst222
357after a burst222
358after a burst222
359after a burst222
360after a burst222
361after a burst222
362after a burst222
363after a burst222
364after a burst222
365after a burst222
366after a burst222
367after a burst222
368after a burst222
369after a burst222
370after a burst222
371after a burst222
372after a burst222
373after a burst222
374after a burst222
375after a burst222
376after a burst222
377after a burst222
378after a burst222
379after a burst222
380after a burst222
381after a burst222
382after a burst222
383after a burst222
384after a burst222
385after a burst222
386after a burst222
387after a burst222
388after a burst222
389after a burst222
390after a burst222
391after a burst222
392after a burst222
393after a burst222
394after a burst222
395after a burst222
396after a burst222
397after a burst222
398after a burst222
399after a burst222
0after a burst, then shed and ramp1,000
1after a burst, then shed and ramp1,000
2after a burst, then shed and ramp1,000
3after a burst, then shed and ramp1,000
4after a burst, then shed and ramp1,000
5after a burst, then shed and ramp1,000
6after a burst, then shed and ramp1,000
7after a burst, then shed and ramp1,000
8after a burst, then shed and ramp1,000
9after a burst, then shed and ramp1,000
10after a burst, then shed and ramp2,000
11after a burst, then shed and ramp222
12after a burst, then shed and ramp222
13after a burst, then shed and ramp222
14after a burst, then shed and ramp222
15after a burst, then shed and ramp222
16after a burst, then shed and ramp222
17after a burst, then shed and ramp222
18after a burst, then shed and ramp222
19after a burst, then shed and ramp222
20after a burst, then shed and ramp222
21after a burst, then shed and ramp222
22after a burst, then shed and ramp222
23after a burst, then shed and ramp222
24after a burst, then shed and ramp222
25after a burst, then shed and ramp222
26after a burst, then shed and ramp222
27after a burst, then shed and ramp222
28after a burst, then shed and ramp222
29after a burst, then shed and ramp222
30after a burst, then shed and ramp222
31after a burst, then shed and ramp222
32after a burst, then shed and ramp222
33after a burst, then shed and ramp222
34after a burst, then shed and ramp222
35after a burst, then shed and ramp222
36after a burst, then shed and ramp222
37after a burst, then shed and ramp222
38after a burst, then shed and ramp222
39after a burst, then shed and ramp222
40after a burst, then shed and ramp222
41after a burst, then shed and ramp222
42after a burst, then shed and ramp222
43after a burst, then shed and ramp222
44after a burst, then shed and ramp222
45after a burst, then shed and ramp222
46after a burst, then shed and ramp222
47after a burst, then shed and ramp222
48after a burst, then shed and ramp222
49after a burst, then shed and ramp222
50after a burst, then shed and ramp222
51after a burst, then shed and ramp222
52after a burst, then shed and ramp222
53after a burst, then shed and ramp222
54after a burst, then shed and ramp222
55after a burst, then shed and ramp222
56after a burst, then shed and ramp222
57after a burst, then shed and ramp222
58after a burst, then shed and ramp222
59after a burst, then shed and ramp222
60after a burst, then shed and ramp222
61after a burst, then shed and ramp222
62after a burst, then shed and ramp222
63after a burst, then shed and ramp222
64after a burst, then shed and ramp222
65after a burst, then shed and ramp222
66after a burst, then shed and ramp222
67after a burst, then shed and ramp222
68after a burst, then shed and ramp222
69after a burst, then shed and ramp222
70after a burst, then shed and ramp222
71after a burst, then shed and ramp222
72after a burst, then shed and ramp222
73after a burst, then shed and ramp222
74after a burst, then shed and ramp222
75after a burst, then shed and ramp222
76after a burst, then shed and ramp222
77after a burst, then shed and ramp222
78after a burst, then shed and ramp222
79after a burst, then shed and ramp222
80after a burst, then shed and ramp222
81after a burst, then shed and ramp222
82after a burst, then shed and ramp222
83after a burst, then shed and ramp222
84after a burst, then shed and ramp222
85after a burst, then shed and ramp222
86after a burst, then shed and ramp222
87after a burst, then shed and ramp222
88after a burst, then shed and ramp222
89after a burst, then shed and ramp222
90after a burst, then shed and ramp222
91after a burst, then shed and ramp222
92after a burst, then shed and ramp222
93after a burst, then shed and ramp222
94after a burst, then shed and ramp222
95after a burst, then shed and ramp222
96after a burst, then shed and ramp222
97after a burst, then shed and ramp222
98after a burst, then shed and ramp222
99after a burst, then shed and ramp222
100after a burst, then shed and ramp222
101after a burst, then shed and ramp2,000
102after a burst, then shed and ramp350
103after a burst, then shed and ramp372
104after a burst, then shed and ramp394
105after a burst, then shed and ramp416
106after a burst, then shed and ramp439
107after a burst, then shed and ramp461
108after a burst, then shed and ramp483
109after a burst, then shed and ramp505
110after a burst, then shed and ramp528
111after a burst, then shed and ramp550
112after a burst, then shed and ramp572
113after a burst, then shed and ramp594
114after a burst, then shed and ramp616
115after a burst, then shed and ramp639
116after a burst, then shed and ramp661
117after a burst, then shed and ramp683
118after a burst, then shed and ramp705
119after a burst, then shed and ramp728
120after a burst, then shed and ramp750
121after a burst, then shed and ramp772
122after a burst, then shed and ramp794
123after a burst, then shed and ramp816
124after a burst, then shed and ramp839
125after a burst, then shed and ramp861
126after a burst, then shed and ramp883
127after a burst, then shed and ramp905
128after a burst, then shed and ramp928
129after a burst, then shed and ramp950
130after a burst, then shed and ramp972
131after a burst, then shed and ramp994
132after a burst, then shed and ramp1,000
133after a burst, then shed and ramp1,000
134after a burst, then shed and ramp1,000
135after a burst, then shed and ramp1,000
136after a burst, then shed and ramp1,000
137after a burst, then shed and ramp1,000
138after a burst, then shed and ramp1,000
139after a burst, then shed and ramp1,000
140after a burst, then shed and ramp1,000
141after a burst, then shed and ramp1,000
142after a burst, then shed and ramp1,000
143after a burst, then shed and ramp1,000
144after a burst, then shed and ramp1,000
145after a burst, then shed and ramp1,000
146after a burst, then shed and ramp1,000
147after a burst, then shed and ramp1,000
148after a burst, then shed and ramp1,000
149after a burst, then shed and ramp1,000
150after a burst, then shed and ramp1,000
151after a burst, then shed and ramp1,000
152after a burst, then shed and ramp1,000
153after a burst, then shed and ramp1,000
154after a burst, then shed and ramp1,000
155after a burst, then shed and ramp1,000
156after a burst, then shed and ramp1,000
157after a burst, then shed and ramp1,000
158after a burst, then shed and ramp1,000
159after a burst, then shed and ramp1,000
160after a burst, then shed and ramp1,000
161after a burst, then shed and ramp1,000
162after a burst, then shed and ramp1,000
163after a burst, then shed and ramp1,000
164after a burst, then shed and ramp1,000
165after a burst, then shed and ramp1,000
166after a burst, then shed and ramp1,000
167after a burst, then shed and ramp1,000
168after a burst, then shed and ramp1,000
169after a burst, then shed and ramp1,000
170after a burst, then shed and ramp1,000
171after a burst, then shed and ramp1,000
172after a burst, then shed and ramp1,000
173after a burst, then shed and ramp1,000
174after a burst, then shed and ramp1,000
175after a burst, then shed and ramp1,000
176after a burst, then shed and ramp1,000
177after a burst, then shed and ramp1,000
178after a burst, then shed and ramp1,000
179after a burst, then shed and ramp1,000
180after a burst, then shed and ramp1,000
181after a burst, then shed and ramp1,000
182after a burst, then shed and ramp1,000
183after a burst, then shed and ramp1,000
184after a burst, then shed and ramp1,000
185after a burst, then shed and ramp1,000
186after a burst, then shed and ramp1,000
187after a burst, then shed and ramp1,000
188after a burst, then shed and ramp1,000
189after a burst, then shed and ramp1,000
190after a burst, then shed and ramp1,000
191after a burst, then shed and ramp1,000
192after a burst, then shed and ramp1,000
193after a burst, then shed and ramp1,000
194after a burst, then shed and ramp1,000
195after a burst, then shed and ramp1,000
196after a burst, then shed and ramp1,000
197after a burst, then shed and ramp1,000
198after a burst, then shed and ramp1,000
199after a burst, then shed and ramp1,000
200after a burst, then shed and ramp1,000
201after a burst, then shed and ramp1,000
202after a burst, then shed and ramp1,000
203after a burst, then shed and ramp1,000
204after a burst, then shed and ramp1,000
205after a burst, then shed and ramp1,000
206after a burst, then shed and ramp1,000
207after a burst, then shed and ramp1,000
208after a burst, then shed and ramp1,000
209after a burst, then shed and ramp1,000
210after a burst, then shed and ramp1,000
211after a burst, then shed and ramp1,000
212after a burst, then shed and ramp1,000
213after a burst, then shed and ramp1,000
214after a burst, then shed and ramp1,000
215after a burst, then shed and ramp1,000
216after a burst, then shed and ramp1,000
217after a burst, then shed and ramp1,000
218after a burst, then shed and ramp1,000
219after a burst, then shed and ramp1,000
220after a burst, then shed and ramp1,000
221after a burst, then shed and ramp1,000
222after a burst, then shed and ramp1,000
223after a burst, then shed and ramp1,000
224after a burst, then shed and ramp1,000
225after a burst, then shed and ramp1,000
226after a burst, then shed and ramp1,000
227after a burst, then shed and ramp1,000
228after a burst, then shed and ramp1,000
229after a burst, then shed and ramp1,000
230after a burst, then shed and ramp1,000
231after a burst, then shed and ramp1,000
232after a burst, then shed and ramp1,000
233after a burst, then shed and ramp1,000
234after a burst, then shed and ramp1,000
235after a burst, then shed and ramp1,000
236after a burst, then shed and ramp1,000
237after a burst, then shed and ramp1,000
238after a burst, then shed and ramp1,000
239after a burst, then shed and ramp1,000
240after a burst, then shed and ramp1,000
241after a burst, then shed and ramp1,000
242after a burst, then shed and ramp1,000
243after a burst, then shed and ramp1,000
244after a burst, then shed and ramp1,000
245after a burst, then shed and ramp1,000
246after a burst, then shed and ramp1,000
247after a burst, then shed and ramp1,000
248after a burst, then shed and ramp1,000
249after a burst, then shed and ramp1,000
250after a burst, then shed and ramp1,000
251after a burst, then shed and ramp1,000
252after a burst, then shed and ramp1,000
253after a burst, then shed and ramp1,000
254after a burst, then shed and ramp1,000
255after a burst, then shed and ramp1,000
256after a burst, then shed and ramp1,000
257after a burst, then shed and ramp1,000
258after a burst, then shed and ramp1,000
259after a burst, then shed and ramp1,000
260after a burst, then shed and ramp1,000
261after a burst, then shed and ramp1,000
262after a burst, then shed and ramp1,000
263after a burst, then shed and ramp1,000
264after a burst, then shed and ramp1,000
265after a burst, then shed and ramp1,000
266after a burst, then shed and ramp1,000
267after a burst, then shed and ramp1,000
268after a burst, then shed and ramp1,000
269after a burst, then shed and ramp1,000
270after a burst, then shed and ramp1,000
271after a burst, then shed and ramp1,000
272after a burst, then shed and ramp1,000
273after a burst, then shed and ramp1,000
274after a burst, then shed and ramp1,000
275after a burst, then shed and ramp1,000
276after a burst, then shed and ramp1,000
277after a burst, then shed and ramp1,000
278after a burst, then shed and ramp1,000
279after a burst, then shed and ramp1,000
280after a burst, then shed and ramp1,000
281after a burst, then shed and ramp1,000
282after a burst, then shed and ramp1,000
283after a burst, then shed and ramp1,000
284after a burst, then shed and ramp1,000
285after a burst, then shed and ramp1,000
286after a burst, then shed and ramp1,000
287after a burst, then shed and ramp1,000
288after a burst, then shed and ramp1,000
289after a burst, then shed and ramp1,000
290after a burst, then shed and ramp1,000
291after a burst, then shed and ramp1,000
292after a burst, then shed and ramp1,000
293after a burst, then shed and ramp1,000
294after a burst, then shed and ramp1,000
295after a burst, then shed and ramp1,000
296after a burst, then shed and ramp1,000
297after a burst, then shed and ramp1,000
298after a burst, then shed and ramp1,000
299after a burst, then shed and ramp1,000
300after a burst, then shed and ramp1,000
301after a burst, then shed and ramp1,000
302after a burst, then shed and ramp1,000
303after a burst, then shed and ramp1,000
304after a burst, then shed and ramp1,000
305after a burst, then shed and ramp1,000
306after a burst, then shed and ramp1,000
307after a burst, then shed and ramp1,000
308after a burst, then shed and ramp1,000
309after a burst, then shed and ramp1,000
310after a burst, then shed and ramp1,000
311after a burst, then shed and ramp1,000
312after a burst, then shed and ramp1,000
313after a burst, then shed and ramp1,000
314after a burst, then shed and ramp1,000
315after a burst, then shed and ramp1,000
316after a burst, then shed and ramp1,000
317after a burst, then shed and ramp1,000
318after a burst, then shed and ramp1,000
319after a burst, then shed and ramp1,000
320after a burst, then shed and ramp1,000
321after a burst, then shed and ramp1,000
322after a burst, then shed and ramp1,000
323after a burst, then shed and ramp1,000
324after a burst, then shed and ramp1,000
325after a burst, then shed and ramp1,000
326after a burst, then shed and ramp1,000
327after a burst, then shed and ramp1,000
328after a burst, then shed and ramp1,000
329after a burst, then shed and ramp1,000
330after a burst, then shed and ramp1,000
331after a burst, then shed and ramp1,000
332after a burst, then shed and ramp1,000
333after a burst, then shed and ramp1,000
334after a burst, then shed and ramp1,000
335after a burst, then shed and ramp1,000
336after a burst, then shed and ramp1,000
337after a burst, then shed and ramp1,000
338after a burst, then shed and ramp1,000
339after a burst, then shed and ramp1,000
340after a burst, then shed and ramp1,000
341after a burst, then shed and ramp1,000
342after a burst, then shed and ramp1,000
343after a burst, then shed and ramp1,000
344after a burst, then shed and ramp1,000
345after a burst, then shed and ramp1,000
346after a burst, then shed and ramp1,000
347after a burst, then shed and ramp1,000
348after a burst, then shed and ramp1,000
349after a burst, then shed and ramp1,000
350after a burst, then shed and ramp1,000
351after a burst, then shed and ramp1,000
352after a burst, then shed and ramp1,000
353after a burst, then shed and ramp1,000
354after a burst, then shed and ramp1,000
355after a burst, then shed and ramp1,000
356after a burst, then shed and ramp1,000
357after a burst, then shed and ramp1,000
358after a burst, then shed and ramp1,000
359after a burst, then shed and ramp1,000
360after a burst, then shed and ramp1,000
361after a burst, then shed and ramp1,000
362after a burst, then shed and ramp1,000
363after a burst, then shed and ramp1,000
364after a burst, then shed and ramp1,000
365after a burst, then shed and ramp1,000
366after a burst, then shed and ramp1,000
367after a burst, then shed and ramp1,000
368after a burst, then shed and ramp1,000
369after a burst, then shed and ramp1,000
370after a burst, then shed and ramp1,000
371after a burst, then shed and ramp1,000
372after a burst, then shed and ramp1,000
373after a burst, then shed and ramp1,000
374after a burst, then shed and ramp1,000
375after a burst, then shed and ramp1,000
376after a burst, then shed and ramp1,000
377after a burst, then shed and ramp1,000
378after a burst, then shed and ramp1,000
379after a burst, then shed and ramp1,000
380after a burst, then shed and ramp1,000
381after a burst, then shed and ramp1,000
382after a burst, then shed and ramp1,000
383after a burst, then shed and ramp1,000
384after a burst, then shed and ramp1,000
385after a burst, then shed and ramp1,000
386after a burst, then shed and ramp1,000
387after a burst, then shed and ramp1,000
388after a burst, then shed and ramp1,000
389after a burst, then shed and ramp1,000
390after a burst, then shed and ramp1,000
391after a burst, then shed and ramp1,000
392after a burst, then shed and ramp1,000
393after a burst, then shed and ramp1,000
394after a burst, then shed and ramp1,000
395after a burst, then shed and ramp1,000
396after a burst, then shed and ramp1,000
397after a burst, then shed and ramp1,000
398after a burst, then shed and ramp1,000
399after a burst, then shed and ramp1,000
macOS 26.6.2 · Python 3.13.3 · run 2026-10-20

End state by arrival rate and start

End state by arrival rate and start
λ (requests/s)StartEnd state
500healthyhealthy
500after a bursthealthy
1,000healthyhealthy
1,000after a burstdegraded
1,500healthyhealthy
1,500after a burstdegraded
1,900healthyhealthy
1,900after a burstdegraded
Output · uv run find-the-metastable-band.py
lambda =    500: healthy start -> healthy   after a burst -> healthy
lambda =   1000: healthy start -> healthy   after a burst -> degraded
lambda =   1500: healthy start -> healthy   after a burst -> degraded
lambda =   1900: healthy start -> healthy   after a burst -> degraded
lambda = 1000 after a burst, with shed-and-ramp: healthy   (band: 667 < lambda < 2000)

What we found

Exactly the predicted band: at 500 requests/s the burst run recovered (healthy); at 1,000, 1,500 and 1,900 it stayed degraded for the rest of the run, while the healthy start at the same rates stayed healthy. Shed-and-ramp at λ = 1,000 brought the degraded system back: yes.


Read it

The same load, the same code and the same hardware give two different systems, and which one you have depends on history. That is why metastable failures survive the removal of their trigger, and why "the traffic is back to normal and it is still down" is their signature. Recovery means removing the sustaining effect: shed load below C/k long enough for the queue to empty, then ramp up.


Go further

Plot over time for λ = 1,000 to see the two stable states. Then lower the load to 500 and check that the system recovers.