Skip to content

An open-source, faster Devin alternative

TypeScript

config(pool): give prod the deep MicroVM pool and stop dev's reaper eating it

Brian Reardonf769be37f450
diff --git a/cloudflare-workers/api-edge/wrangler.prod.toml b/cloudflare-workers/api-edge/wrangler.prod.toml
index c70cf271..a9e30747 100644
--- a/cloudflare-workers/api-edge/wrangler.prod.toml
+++ b/cloudflare-workers/api-edge/wrangler.prod.toml
@@ -145,6 +145,17 @@ crons = ["*/5 * * * *"]
[vars]
WORKER_ENV = "prod"
+# PoolStock sizing. SHARDS × TARGET must stay ≤ the cell's MicroVM pool
+# (OPENSANDBOX_MICROVM_POOL_TARGET on the CP) or every shard sits permanently
+# below low-water, restocks on every claim, and competes for a supply that can
+# never satisfy it — creates then fall through to the ~10× slower CP path.
+#
+# 8 × 18 = 144 against prod's pool of 150. These were unset until 2026-08-20,
+# which meant the DO defaults (38 per shard = 304 fleet) applied against a pool
+# of 5 — every shard starved and edge-claim effectively never hit. Raise the CP
+# pool target FIRST, then this. See the SIZING INVARIANT in src/pool_stock.ts.
+POOL_STOCK_TARGET = "18"
+POOL_STOCK_LOW_WATER = "9"
# Cells eligible for new-org home assignment live in the D1 `cells` table
# (`accepts_new_orgs` column), not an env list — toggle a row to onboard a cell,
# no deploy. See pickHomeCell in src/index.ts.
diff --git a/cloudflare-workers/api-edge/wrangler.toml b/cloudflare-workers/api-edge/wrangler.toml
index b272b595..ce95764c 100644
--- a/cloudflare-workers/api-edge/wrangler.toml
+++ b/cloudflare-workers/api-edge/wrangler.toml
@@ -210,8 +210,14 @@ PAUSED_CAP = "10"
# more than the pool maintains starves every shard. Raise the pool first, then
# this. Measured before the change: burst-30 returned exactly 24 fast (90ms
# median) and dropped the remaining 6 to the CP.
-POOL_STOCK_TARGET = "18"
-POOL_STOCK_LOW_WATER = "9"
+#
+# 2026-08-20: dev's MicroVM pool dropped 150 → 30 so prod could hold the deep
+# pool instead (both cells draw on the SAME us-east-1 account, so depth here is
+# depth prod cannot have). 8 × 3 = 24 against 30, restoring the ratio this file
+# used to carry. The tuning above is kept because it is the reasoning that will
+# be needed again if dev ever takes the deep pool back.
+POOL_STOCK_TARGET = "3"
+POOL_STOCK_LOW_WATER = "2"
# Cells eligible for new-org home assignment are NOT configured here anymore —
# it's the `accepts_new_orgs` column on the D1 `cells` table (single source of
# truth, toggled per-row without a deploy). See pickHomeCell in src/index.ts.