-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
40 lines (40 loc) · 1.72 KB
/
Copy pathwrangler.jsonc
File metadata and controls
40 lines (40 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
"name": "fmw-preview",
"main": "src/index.ts",
"compatibility_date": "2026-07-01",
"compatibility_flags": ["nodejs_compat"],
"vars": {
"FACTORIO_VERSION": "2.1.12",
"MONTHLY_RENDER_BUDGET": "5000",
"ALLOWED_ORIGIN": "https://map.factorygamefan.com",
},
"containers": [
{
"class_name": "PreviewContainer",
"image": "../container/Dockerfile",
// Memory is billed on PROVISIONED size for the whole time an instance is
// awake, not on what the process touches - so instance_type is the single
// biggest cost lever here, and it was 4x oversized. Measured over 20 days
// of production (containersMetricsAdaptiveGroups): peak 603 MiB, idle
// ~205 MiB, peak disk 522 MiB. `basic` is 1 GiB / 4 GB, ~40% memory
// headroom over the observed peak. `size` is pinned to 1024 in
// src/schema.ts, so no request can enlarge a render past that peak.
// Re-measure before shrinking further; the next size down is `lite`
// (256 MiB), which the 603 MiB peak rules out.
"instance_type": "basic",
// The worker only ever addresses idFromName("pool-0"), so a second
// instance is unreachable by design - but max_instances is what caps the
// blast radius if that ever changes or an instance leaks. At 3 this bill
// could silently triple.
"max_instances": 1,
},
],
"durable_objects": {
"bindings": [
{ "class_name": "PreviewContainer", "name": "PREVIEW_CONTAINER" },
{ "class_name": "RenderBudget", "name": "RENDER_BUDGET" },
],
},
"r2_buckets": [{ "binding": "PREVIEW_CACHE", "bucket_name": "fmw-preview-cache" }],
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["PreviewContainer", "RenderBudget"] }],
}