Commit b8ded33
fix: synchronous endpoint + no semaphore, let Cloud Run scale like Modal (#282)
The fire-and-forget + semaphore design caused all jobs to queue on one
instance. Cloud Run couldn't see background threads as "busy" so it
never scaled to new instances.
Fix: make endpoint synchronous (await executor) with concurrency=1.
Cloud Run sees each request as active during processing and scales to
new GPU instances for concurrent jobs — matching Modal's .spawn().
Increase client POST timeout to 1800s to match.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 349ba98 commit b8ded33
2 files changed
Lines changed: 12 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
| |||
231 | 230 | | |
232 | 231 | | |
233 | 232 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 233 | + | |
| 234 | + | |
239 | 235 | | |
240 | 236 | | |
241 | 237 | | |
| |||
379 | 375 | | |
380 | 376 | | |
381 | 377 | | |
382 | | - | |
383 | | - | |
| 378 | + | |
384 | 379 | | |
385 | 380 | | |
386 | 381 | | |
| |||
507 | 502 | | |
508 | 503 | | |
509 | 504 | | |
510 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
511 | 509 | | |
512 | | - | |
| 510 | + | |
513 | 511 | | |
514 | 512 | | |
515 | 513 | | |
| |||
551 | 549 | | |
552 | 550 | | |
553 | 551 | | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
| 552 | + | |
| 553 | + | |
563 | 554 | | |
564 | 555 | | |
565 | 556 | | |
| |||
0 commit comments