| @@ -44,9 +44,10 @@ running its exit handler, up to five minutes of writes are gone. Lower |
| 44 | `max_containers=1` is not tuning, it is a correctness requirement. Two | 44 | `max_containers=1` is not tuning, it is a correctness requirement. Two |
| 45 | containers would mean two SQLite writers over two independent copies of the | 45 | containers would mean two SQLite writers over two independent copies of the |
| 46 | data, and the Volume's last-write-wins semantics would silently discard one of | 46 | data, and the Volume's last-write-wins semantics would silently discard one of |
| 47 | -them. `min_containers=1` keeps that container alive because Glean's background | 47 | +them. `min_containers=0` lets that container scale to zero when idle. Glean's |
| 48 | -workers — the Jetstream websocket consumer and the PDS sync / clustering / | 48 | +background workers — the Jetstream websocket consumer and the PDS sync / |
| 49 | -feed-fetch loops — only run while a container exists. | 49 | +clustering / feed-fetch loops — only run while a container exists, so they |
| | 50 | +pause once it scales down and resume when the next request wakes one. |
| 50 | | 51 | |
| 51 | ## Secrets | 52 | ## Secrets |
| 52 | | 53 | |
| @@ -75,8 +76,9 @@ Modal's model is autoscaling ephemeral containers. Glean is a stateful, |
| 75 | single-writer, always-on server. The mismatch is real and this deployment | 76 | single-writer, always-on server. The mismatch is real and this deployment |
| 76 | manages it rather than resolving it: | 77 | manages it rather than resolving it: |
| 77 | | 78 | |
| 78 | -- **One container, always warm.** No horizontal scaling; `min_containers=1` | 79 | +- **One container, scaled to zero when idle.** No horizontal scaling, and |
| 79 | - means you pay for an idle container rather than scaling to zero. | 80 | + with `min_containers=0` the first request after an idle period pays a cold |
| | 81 | + start while the background workers are stopped in between. |
| 80 | - **Snapshot durability, not continuous durability.** See the window above. | 82 | - **Snapshot durability, not continuous durability.** See the window above. |
| 81 | - **Container churn costs data.** Any restart that skips the exit handler — a | 83 | - **Container churn costs data.** Any restart that skips the exit handler — a |
| 82 | hard kill, an OOM, a preemption — loses the interval. | 84 | hard kill, an OOM, a preemption — loses the interval. |