What happened
Why a rush that has ended keeps hurting
Think of a restaurant that seats everyone who walks in. A rush arrives, the kitchen falls behind, and diners wait longer between courses, so they stay longer. The rush ends, but the room stays jammed, because the people inside are not leaving.
Your server is that restaurant, and its kitchen is the serving software. SGLang and vLLM are the two common free ones. They take each request from your app, run the model on the GPUs and send back the reply.
Monday morning, replayed as a restaurant
Your server is the restaurant and each dot is a diner: one agent task. Press play and watch the room after the rush ends, then try the two fixes.
Regular diners: 42 · Rush diners: 0 · Queued safely outside: 0
Moment 1 of 6
A normal morning: 42 diners, and each next course arrives in a fifth of a second.
Our illustrationWhat happened
- 10:00A normal morning: 42 diners, and each next course arrives in a fifth of a second.
- 10:05The rush walks in. Everyone gets a table, and the kitchen starts falling behind.
- 10:10The rush is over: arrivals are back to normal. But 65 rush diners are still at their tables.
- 10:20Slow courses keep everyone seated longer, so regular diners now pile up too.
- 10:35A minute between courses. The last rush diners are only now leaving.
- 11:15No rush left, yet 2.4 times the normal crowd. Nothing unusual arrived. The room is stuck.
What if: Send the rush home
- 10:12The rush diners leave at 10:12: in server terms, their tasks are cancelled.
- 10:14Back to a normal room two minutes later, as in the researchers' test.
Sending the rush home (cancelling its tasks) brought replies back to normal in two minutes.
What if: Replay with a door host
- 10:05Same rush, but a host seats new diners only when a table frees. The rest wait outside.
- 10:10The rush is over. Inside, courses still come in a third of a second.
- 10:35The queue outside has been seated; the room never overflowed.
- 11:15A normal Monday.
With a host at the door, no simulated rush of three to six times normal left the server stuck.
Server terms: the room is memory, the wait between courses is the wait per reply, the host limits new tasks. 10:00, 10:10 and the pile-up were measured; values marked ours are our illustration between them. The 60-second wait comes from a similar measured run.
Sources: [1]
Take one rush task: a developer asks the agent to fix a failing test, about 33 steps, each resending the whole conversation. After the rush, every step rereads it from page one; the picture in How it happens shows the cost.
Slow steps keep tasks open, open tasks hold memory, and full memory slows every step. That loop outlives the rush. Your dashboards stayed calm because they watch how busy the chips are, and the chips were never the problem.
A bigger room: 40 times more memory
The room fills later, but it still fills
A door for new tasks
The rush waits a few minutes at the door
Why now
Rushes like this are ordinary: a customer onboarding, a launch, a test pipeline starting fifty agent runs at once (our examples). Alibaba's busiest ten minutes ran 16 to 49% above its hourly average; near its limit, a 25 to 50% rise left the server stuck.
The server isn't too small; it's too crowded. Fix crowding with a door, not a bigger room.
Join free to read the rest
Join free to read how they did it, the exposure check, the fix step by step, how to be ready for the next one, and what we don't know yet.
Are you exposed?
Are your self-hosted AI agents at risk of getting stuck?
Check your setup in under a minute. Answer for your own company. The meter moves with every answer.
If you've been hit
The same Monday, 10:12
Replies take 9 seconds, not 0.2. 110 tasks are open; normal is 42. Traffic is back to normal. The rush is over, but its 65 tasks are still open, and every step is rereading from page one.
-
PlatformHold or cancel the rush's tasks
You should see: In the researchers' test, replies were back to normal in two minutes
If your agent app or a door can hold tasks, hold those that started between 10:00 and 10:10. Hold new ones for a few minutes too. No way to hold tasks yet? Cancel the rush's tasks and ask those customers to retry in ten minutes. Only cancelling was tested; holding should work the same way, because a held task stops taking up memory.
-
CTOCan't tell which tasks? Slow the door
You should see: Fewer open tasks every ten minutes than the ten before
Going back to normal traffic is not enough. In the researchers' simulations, the server recovered only when new tasks came in at a fifth of the most it normally handles. Hold all new tasks and let them in at that slower pace until open tasks are back to normal.
Fix it
The fix, by deadline
Step by step, with who does each one.
See it coming, then stop it
Next time, an alarm fires during the rush and a door keeps the room from jamming.
-
PlatformAlarm on stored conversations
You should see: In the rehearsal, the alarm fires during the rush, before replies slow
SGLang publishes the share of each request it finds already stored; your monitoring tool reads it. The researchers read it every 5 seconds through Prometheus, a common monitoring program. On a normal day it is 95%. During the rush it slid to 80%, then collapsed to 30%. Our suggestion: alarm at 85%, while it is still sliding.
-
PlatformBuild a door for new tasks
You should see: On Monday, the 65 rush tasks queue for a few minutes instead of jamming the room
SGLang sees single requests, not tasks, so the door sits between your agent app and SGLang, as the researchers built theirs. It lets a new task in only while the open conversations fit in memory; the rest wait. In simulated rushes of three to six times normal, no server with a door got stuck, and fewer than 2.2% of tasks were turned away.
-
CTODecide who waits at the door
You should see: A written rule for who waits first
A door means someone queues during a rush. A door that never adjusts is its own problem: in the tests, a fixed limit made new users wait 26 to 39 minutes. Agree with sales, in advance, whose tasks go first.
-
PlatformRehearse a rush
You should see: The alarm fires, the door holds, and replies stay under a second
Replay a day of your recorded agent traffic at twice the speed on a test server.
-
API usersStop your agents becoming the rush
You should see: In a test, retries spread out over time instead of arriving together
The jam sits on your provider's servers. When the provider says it is busy, make each agent wait a growing, random time before retrying. If every agent retries at once, your own agents are the next rush.
Build the door into your own app
This is our suggestion, not something the researchers tested. Your agent app already builds every conversation it sends, so it knows how long each one is. That is all a task meter needs.
The task meter inside your app
Our suggestion, not tested by the researchers. Your app already builds every conversation, so it can count them.
tokens
Server memory: 100% is full: 85%Our suggestion
Stage 1 of 4 · Measure
42 tasks open. The app keeps a running total of their conversation lengths.
DecisionStart new tasks
- Measure42 tasks open. The app keeps a running total of their conversation lengths.Start new tasks
- EstimateA rush bug fix arrives. Past bug fixes show how long its conversation will grow.Add its estimate
- DecideThe needle reaches 85% of what memory holds.Queue new tasks
- Pass to the next stepRunning tasks always go on to their next step; each finished fix frees room.Let one queued task in
85% is our starting point; tune it with the stored-conversation alarm. The researchers' tool estimates growth from a task's first request.
Sources: [1]
How much does fixing stuck AI agents cost?
Your engineers' time; no new hardware. The source gives no price.
After the fix
Keep it from coming back
The fix is in. These are the checks that tell you it stays that way.
How you'll know it worked
After every real rush, the platform team checks two numbers.
-
PlatformCheck stored conversations recover
You should see: Back to 95% within minutes of a rush ending
After a collapse, the share stayed at 26 to 37% in the simulations, against 81 to 93% in healthy runs at the same traffic. A slow return means the door is set too wide.
-
PlatformTime the wait at the door
You should see: Half of new tasks get a first reply within 20 seconds; the researchers' tool managed 18
A door set too narrow swaps a jam for a long queue.
Precautions
What would have reduced the impact
Each row below is a defence that would have limited this attack. Tick "We already do this" on the ones your company has; this score counts them. Every row left unticked is listed under "Your gaps", with the Fix it step that closes it.
The decision: build a door, not a bigger room
- 1
Hold or cancel the rush's tasks (step 1)
A stuck hour becomes about two minutes
- 2
A door for new tasks (step 4)
During an hour of overload, open tasks fell from 852 to 252, and 1.25 times more tasks finished
- 3
Basin, the researchers' full tool, once public
2.4 to 3.6 times the finished work on the same real GPUs
- 4
All of it, on a calm day
Basin finished at least 99.6% as much as other methods, so protection costs almost nothing
Do more GPUs stop self-hosted AI agents getting stuck?
- 1
Forty times more memory
The room fills later: the server took twice the traffic before getting stuck
- 2
Then a big enough rush
It still gets stuck, and each reply took over five minutes to start
Each one is closed by the Fix it step named on its row.
How they did it
Why do self-hosted AI agents get stuck after a traffic spike?
Follow the rush through the kitchen, using the researchers' measurements.
- 1
The rush fills the room
65 extra tasks arrive in ten minutes, and 110 are open by 10:10. Their conversations need about twice the memory there is.
- 2
Bookmarks are thrown away
With memory full, stored conversations are thrown out. Each returning step rereads from page one, so the reading work rose 11 to 14 times.
One bug fix, step by step
The same task on a normal day and after the rush.
TaskFix a failing test
Normal day
Wait per step: 0.2 seconds
- 1Read the failing test
- 2Open the file it checks
- 3Run the tests
- 4Edit the code
- 5Run the tests again
- about 33 steps in all
Whole fixabout 7 seconds
Reads only the new part of each step
After the rush
Wait per step: about 60 seconds
- 1Read the failing test
- 2Open the file it checks
- 3Run the tests
- 4Edit the code
- 5Run the tests again
- about 33 steps in all
Whole fixabout 33 minutes
Rereads the whole conversation every step
Step 1 of 5
Read the failing test
Why it keeps getting worse
- Slower steps
- Tasks stay open
- Memory fills
- More rereading
33 steps is our average of the researchers' 216 recorded tasks; the totals are our sums. Measured: tasks after the rush took 1.8 to 6.1 times longer.
Sources: [1]
- 3
Tasks stay, so the room stays full
A task ends only after its last step, so slow steps keep it open. Fewer finish than arrive: regular tasks reach 1.7 times normal by 10:35 and 2.4 times by 11:15.
Our view: the loop feeds itself, so waiting does not end it. Removing the rush's tasks does, which is why step 1 works in minutes.
What we don't know yet
Limits, and what would change our mind
What the sources leave open, and how to act anyway.
Every real-GPU test used one model (Qwen) on one serving program (SGLang)
Run the rehearsal in step 6 on your own setup before relying on these numbers
Most comparisons come from the researchers' simulation; it usually matched real runs to about 10%, but was once far off
Treat simulated numbers as direction, real-GPU numbers as measured
Basin's code is not public
Steps 1 to 6 and the meter need none of it: build them now
What would change our mind
Your rehearsal recovers on its own within minutes.
SGLang or vLLM ships a built-in door for agent tasks.
Other teams test different models and see no stuck servers.
Sources
Check our working
Found this useful? Send it to someone who should read it.