The setup

  • The model: cyankiwi/Qwen3.8-27B-AWQ-INT4, served by vLLM as optra-coder, with thinking on for every call and a context of 131,072 tokens.
  • The servers on 14 Nov:
    • two RTX A5000s at one site (tensor parallel, our share 16 of its 24 streams);
    • two RTX 5090s at another site (tensor parallel, about 26-32 streams);
    • single-RTX-5090 “seats” on two single-card boxes (width 8, raised to 12 that night as a pick).
  • The callers: the studio’s pipeline (story plans, boards, sound plans, music briefs, place and prop reads, repairs), customers’ projects, and our agents. Every call goes through one client (optra_llm) and one gateway, with a key, and is logged.
  • Volume: one farm day (14 Nov IST) carried 6,820 calls. On the evening of 14 Nov, 238-274 calls were waiting at any moment.

1. Boards were most of the work, and the cost was per call, not per line

  • Boards are 82% of the reasoning. Board and board-repair calls were 82% of the Qwen’s reasoning tokens that day: 339 board calls came to about 6.15M reasoning tokens, against about 7.49M for every tag.
  • The board asked one call per 3 spoken lines. One customer’s board of 167 lines took 64 calls. Each call re-sent a 9.8k-token shared prefix (the rules, the whole script, the breakdown) and reasoned a median of 15,206 tokens to write a median of 286. That is 57 reasoning tokens for every answer token, or about 1M reasoning tokens for one board.
  • Reasoning is paid per call, not per line. A 6-line part did not think longer than a 3-line part.
  • The measure: one 7-line scene, one run per arm, thinking on, nothing capped.
Lines a call Reasoning per spoken line Change Calls Wall for the scene
3 (old default) 14,398 10 1,302 s
6 10,026 -30% 8 1,675 s
the whole scene (7) 6,691 -54% 4 1,965 s
  • Quality held. By eye, against a truth written before the run, the 6-line and whole-scene boards were as good as the 3-line one, and better in one way. The 3-line board repeated the same beat across a part boundary: a person stepped down from a crate twice and walked past the same woman twice. Larger parts did not.
  • The trade: fewer, larger calls cost more wall time per board and much less Qwen time. On a Qwen that is the bottleneck, that is the right trade.
  • The same lesson, measured earlier: splitting one thinking call into windows costs a fixed reasoning per window. Six windows cost 3x the tokens for 17% of the wall time.

2. A limit outlives its reason unless someone asks why it is there

  • The 3-line part came from 22 Sep 2026. The gateway then killed any call over 120 seconds, and a whole scene in one reply was killed three times running. The 120-second kill has been gone for weeks, and calls now think for 10-28 minutes, but the 3-line part stayed.
  • The other caps: a sweep found about ten more fixed counts on what a call may carry: 6 plan shots, 6 lines, 20 lines, 12 items, 4 shots and 40 shots. All of them sat under a 28,000-token prompt cap.
  • The rule now: the only limit on a call is the context of the server it goes to, read from that server. When the context grows to 256k, every caller follows with no code change.
  • A reply cap wastes the whole call. A music brief was sent with an 8,192-token cap. The model reasoned to the cap and returned no text. The call failed, was never retried, and the step ran again.
  • The scale of it: on 12 Nov, 48-61% of the decode of the two biggest text steps was cut at the cap and thrown away. On 14 Nov, 159 calls were cut.
  • Token tables hide it. A table of tokens counts only the calls that answered, so it never shows a failed call. In the small tags, 29-48% of calls failed at the cap.

3. A smaller prompt is not a cheaper prompt

  • The rules dominate. The board’s rules block was 70% of its prompt.
  • Cutting context made it worse. Dropping the breakdown’s quotes cut the input by 4-5%, but raised the reasoning by 24% and 125% on two measures, and cut more replies.
  • What a cut costs. A rule leaves a prompt only while code re-checks it. The model reasons longer when it has less to go on.
  • Thinking stays on. Thinking-off and reasoning budgets are never the speed lever: the boards a thinking Qwen writes are the product. Speed comes from the calls’ number and size, the queue, and the routing.

4. A text server is bound by its cache, not its streams

  • Where the memory goes. The 27B AWQ weights take 21 GB of a 5090’s 32 GB. At 92% memory use, about 8 GB is left for the KV cache. The 5090 pair splits the weights across two cards and has about 38 GB for the cache.
  • What fits. One 5090 seat holds about 9 board-length calls at once (one of those boxes ran 9 with 4 waiting inside vLLM at 13 in flight). The pair holds about 30.
  • The only bench of a seat: 4,400-token prompts and 512 tokens of decode gave 79, 69 and 58 tokens/s per stream at 1, 8 and 16 streams. The width of 8 came from a floor of 60 tokens/s a stream.
  • More width on a full cache adds queue, not speed. Read KV use and in-server waiting before raising a width. Spread calls to idle servers instead.

5. The queue: who goes first, and the waits nobody saw

  • The queue held flat and did not drain. It sat at 238-274 for two hours. The servers were answering (124 calls in 10 minutes across four of them), but arrivals matched completions. 58 slots, each held 10-28 minutes by a board’s reasoning, allowed about 3-4 completions a minute.
  • Waiting twice. A call refused by one route in 0.1 s fell back and took a slot new, at the back of the line: a median of 784 s more. Of 744 attempts on that route in a day, 461 were refused “at its share”. The client believed the pair had 32 streams; the gateway held it to 26. The fix keeps the call’s first arrival.
  • Ordering rules starved the oldest call. Priority classes, per-project ranks, aging and a per-tag ceiling meant that at the worst, the oldest call had waited 1 h 43 min. One lane had a single seat for 74-86 waiting calls. The owner’s rule now: a paying customer’s call first, then strictly whoever came first. No other class orders anyone.
  • A wait that hid inside the call. A step took its lane seat, then waited for a slot inside its own call: 25 of 26 seats held, 0 waiting on the lane. The fix: a step starts only when a stream is free, so its wait shows on the turn list.
  • Read the queue carefully:
    • “0 waiting” just after a scheduler restart is an empty table, not a clear queue.
    • A rate is read from finished calls’ usage, never from a live progress line.

6. Routing: fill-first, then fair, then by size

  • Fill-first sent too much to one pair. The gateway filled the 5090 pair first, so the pair ran 32 on a width of 26 while the A5000 pair sat 7 streams under its share.
  • Fair: each call goes to the server with the most free room per width, and none over its width.
  • By size, next: the two multi-GPU servers take boards and other large calls; calls that fit a single seat may use the seats. A call only ever goes to a server whose context fits it, read from that server. New servers join by reporting their own context.

7. Loops cost whole calls

  • Steps re-asked after finishing. Some steps finished but were asked again every cycle. One read whether its design was owed and never whether the design was done, so the step ran again and again. In one hour, the loop detector cut 20 long reasoning calls that were then thrown away.
  • A looped call can be saved. A board call that looped was recovered by asking for the answer from its own reasoning in one follow-up: about 330 s, and a healthy board.

8. Judge the test before you fix the code

  • Main’s suite showed 9 red files. Before anyone touched code, each red was judged: is the code wrong, or the test?
    • Four were tests out of date with a deliberate change. One more test was simply wrong: its file glob matched a measure’s results file.
    • Two were tests whose fixtures had not followed a new switch.
    • One was a real bug in the new fair routing: a server with no cap ranked “fully free” and would have taken every call once the gateway restarted.
  • The lesson: without that step, the bug would have gone live, and four working pieces of code would have been “fixed” to satisfy broken tests.

9. Measure what you cannot see

  • The gaps. Which GPU served a call was not recorded call by call, and a server’s free cache and preemptions sat in a log nobody read. The audit could say “not recorded”, and it did.
  • The fixes: every call’s row names its server, every decision a Qwen path makes records why, and the full audit covers every model the studio calls (Qwen text and vision, Claude, and the image, video and voice models): who called, why, what it cost, and what was wasted.

10. The night of 14-15 Nov: limits, not load, were the problem

  • Where the limits came from. A read of the code’s history found 18 fixed limits on Qwen calls: a 3-line board part, 6 plan and 6 repair shots per call, reply rooms per kind of call, a 28,000-token prompt cap, batch and character budgets, wait timeouts, a one-hour wall, a customers’ share. 13 of the 18 had no word from the owner behind them. Each was added by an agent for a local reason (a gateway that once killed calls at 120 seconds, a speed measure, a guess at a size), and the reason often went away while the number stayed.
  • Limits patched limits. The board’s reply room was raised from 1,400 to 2,800 because a film looped at 1,400; the plan’s room was raised to 12,000 because replies were cut at 7,200. A cut reply is asked again, and that is a loop. So the owner’s rule now: no limit anywhere, and the one guardrail is that nothing loops. A loop is caught where it repeats (a reasoning loop, the same call re-sent, a step asked again with nothing new), stopped, named with its cause and fixed in code.
  • What starved the work. With the limits on, boards, sound plans and music briefs did not get full thinking, and the owner names that as the cause of weak prompts and weak videos. The fix gives every thinking call the server’s whole context less its prompt, read from the server itself.
  • “256 board calls” was mostly one call re-sent. On the five biggest boards, 68-82% of the logged calls never reached the model: the gateway refused them at a server’s share and the client sent them again. The client believed the 5090 pair took 32 calls while the gateway admitted 26, and each new process re-learned the share from a refusal. Of the calls to the A5000 pair’s side, 52 of 57 failures were the gateway refusing our calls at our own share (16 of 24), not the A5000 pair failing. The fix sizes each server by the gateway’s own number, shared by every process, and holds a call until a stream is free anywhere.
  • Free seats beside waiting work. The scheduler gave a freed lane seat only to the same project’s next step; when that project had none, the seat sat empty until the next cycle (median 443 s). At one read, 16 of 68 seats were held while 102 steps waited. Behind that, 37 customer processes sat inside their calls waiting for a stream and filled the customers’ process cap. Two fixes: a freed seat goes to the longest-waiting step at once, and a step starts only when a stream is actually free.
  • The cycle is the wait. A plain step waited a median of about 270 s (p90 about 760 s) from runnable to start, while the step itself ran 21-41 s. Where an event already started the next step, the hand-off was about 38 s. The next design is event-driven: many small project schedulers, each starting a project’s next step the moment the last one ends, with the old cycle only as a slow safety sweep.
  • Capacity was cards, not Qwen. Measured from the logs: a finished film costs about 1 card-minute per second of film. For normal projects the render cards run out 4-5 times before the Qwen does; the Qwen queue was made by a few outlier boards and by the waste above. Start-to-cut ran 12-30 hours for 1-2 hours of work: almost all of it waiting.
  • Two quiet costs. A gateway restart drains for 180 s and then cuts what is still in flight: 16 of 35 calls once, 34 of 48 the next time, each up to 28 minutes of thinking. And two 5090s lent to the Qwen did nothing for hours: a rule freed their Qwen memory because clips were waiting, while a pause kept them from drawing clips.
  • Paying accounts read as free. The farm learned an account’s plan from a field only the owner’s own “set plan” press wrote, so every account that paid by card read free and missed the paid-first order. The fix reads the plan the account actually holds.

Quick Search Our Blogs

Type in keywords and get instant access to related blog posts.